Jump to content
  • Advertisement
Sign in to follow this  
pascalosti

3 Questions clr arrays n stuff..

This topic is 4276 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;
	};

main
// 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
Advertisement
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
{
public:
// members
};

value struct Name
{
// members
};

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

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

Skizz

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!