I need help converting this from C++.NET 2003:
Random r; //r is a random object
r=new Random(); //create the object
into a format that will be acceptable in C++.NET 2005. The current error I get is:
Error1 error C2582: 'operator =' function is unavailable in 'System::Random'
Thanks guys!
-
-
Random ^ r;
r = gcnew Random(); -
What the ****? Man, I've been away from C++ for too long.megame wrote:Random ^ r;
r = gcnew Random();

C# is just so much cleaner, but I'm now afraid that it may be melting my brain!
-
Yeah this is part of the new C++/CLI standard. It will be an official ISO standard now so this is the way to do C++/CLI stuff.
Here are some videos on C++/CLI.
http://channel9.msdn.com/showpost.aspx?postid=181706
http://msdn.microsoft.com/visualc/learning/vcexpvids/default.aspx
http://msdn.microsoft.com/vstudio/tour/vs2005_guided_tour/VS2005pro/Framework/CPlusCLI.htm
http://msdn2.microsoft.com/en-us/library/ms235630.aspx
BTW, Since this is now a standard, it should be available in all C++ tools in the near future.
-
jmbledsoe wrote:
What the ****? Man, I've been away from C++ for too long.
megame wrote: Random ^ r;
r = gcnew Random();

C# is just so much cleaner, but I'm now afraid that it may be melting my brain!
You sense the power of the dark side... 'gcnew'looks Managed! -
This will tell you everything you need to know to port VS2003 C++ programs to VS2005 (VS2005 MSDN needed):
Managed Extensions for C++ Syntax Upgrade Checklist
Link: ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vccore/html/edbded88-7ef3-4757-bd9d-b8f48ac2aada.htm
Why I cannot turn "ms-help://" into links? I've created link manually but it won't work...
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.