-
December 28th, 2011, 04:54 PM
#1
How to Make an array of objects in visual c++ 2010
I need to create an array of objects to hold labels in visual c++ 2010,
i tried:
Object^ *labelArray;
labelArray=new Object^ [15];
but this error came up:
error C2728: 'System::Object ^' : a native array cannot contain this managed type
Did you mean 'array<System::Object ^>'?
So how to make this array and what does it mean by array<System::Object ^>
Thanks
-
December 28th, 2011, 05:55 PM
#2
Re: How to Make an array of objects in visual c++ 2010
Originally Posted by desoky725
I need to create an array of objects to hold labels in visual c++ 2010,
i tried:
Object^ *labelArray;
labelArray=new Object^ [15];
Wrong forum.
That code is Managed C++, not traditional C++. There is a managed C++ forum, and you should post your question there.
Regards,
Paul McKenzie
-
December 29th, 2011, 12:42 PM
#3
Re: How to Make an array of objects in visual c++ 2010
-
January 4th, 2012, 08:31 AM
#4
Re: How to Make an array of objects in visual c++ 2010
array<System::Windows::Forms::Label^,1>^ thelabels=gcnew array<System::Windows::Forms::Label^,1>(5);
creates an array of 5 labels.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|