Sign in to follow this  

3 Questions clr arrays n stuff..

This topic is 4093 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
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

This topic is 4093 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this