0 Lukezzz 8 Years Ago I have tried to delare the List Incr outside the if-statment and then inside the if-statement I declare a new instance of the List but when doing this I get a compilerror that says: left of '.Add' must have class/struct/union List<int>^ Incr; if( textBox1->Text != "" ) { Incr = gcnew List<int>; //Add element Incr.Add(1); } c++
0 Narue 5,707 8 Years Ago >Incr.Add(1); You use the arrow operator to access members of managed references: Incr->Add(1);
0 OPDiscussion Starter Lukezzz 8 Years Ago Ah ofcourse, Thank you Narue.. I confused it with C# /L >Incr.Add(1); You use the arrow operator to access members of managed references: Incr->Add(1);