I read String* in C++ code and got confused, is there any necessarity to use String* ? Can I use char* instead?
E.g. StreamReader has ReadLine() function, why not require user arrange a char array first and the function justs stores the string in it, returns a char* pointer and everything works just fine.
I read String* in C++ code and got confused, is there any necessarity to
Share
Notice that
char*is a pointer to single string or multiple characters (array of chars), whilestring*is a pointer to a single or mulitple (array) of string objects. However, C# doesn’t support pointers to managed types (such as string)Examples: