Sunday, July 12, 2009

C#??structured array??

can you give me a sample of a structured array,, and how to access its elements?? im not sure if im doing it right but when i compile i get errors


public struct stud


{


public string fname;


public string lname;


}





my question is....where should i place the array??? need help please........

C#??structured array??
A struct doesn't stand for structured array, they're two different things. If you want to use a struct, just put it anywhere in the class alongside your methods.





@Jordan Z





An array is ALWAYS limited in memory, which is why it has such fast lookups. You must define a type and size before you allocate an array, no matter what the language. Some languages just do better than others at hiding this from you (ex. ArrayList copies the array to a new one somewhere else, then deletes the original).


No comments:

Post a Comment