Jump to content
  • Advertisement
Sign in to follow this  

3 Questions clr arrays n stuff..

This topic is 4374 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im trying to create a link list with no globals. How do you NULL in .net? Arrays with structs type, How? A good c++ .net 2005 book(currently i have deitel 2003 most of the code is oppsolete)?
ref struct Vehicle{
     // use to move along the link list
	Vehicle ^next;
	Vehicle ^current;
    // data entry
	int ^VIN;
	String ^Model;

// how do you NULL in .net 
// pretty sure "next" needs to be nulled or point somewhere.

Vehicle ^Foreign;
	Foreign = gcnew Vehicle;
	Foreign->Tech = gcnew TechInfo;

// arrays that work for me
int *c[10] = {0,0,0,0,0,0,0,0,0,0};
array<String^>^ sentence = {"stuff"};

// using struct this does not work
array<Vehicle^>^ junk = { "0","0"};

Share this post

Link to post
Share on other sites
NULL is either null in c# or nullptr in C++/CLI.
CLI Arrays with non-CLI structs is not possible (can't mix managed and unmanaged). Use a value class /struct in C++/CLI:

value class Name
// members

value struct Name
// members

array <Name> ^name = gcnew array <Name> (array_size);

Don't know about any books, I've used the MSDN.


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!