how do I use pointers with struct or classes with String members? Is it possible?
[code]
struct myName
{
string first;
string last;
}
myName * n;
I get an error: Cannot take the address or size of a variable of a managed type ('memFunc_app.Form1.myName')
is there a way to have a struct with a "string" type member? I tried StringBuilder but couldn't make it work. I could use array of char, but i don't know an easy way of initializing the array the way it is done in c++.
for instance:
can't do this in c#Code://c++ code char * str; str = new char[100]; str = "John";




Reply With Quote