If I do
string someString = "hello";
char c = someString[2];
does the c variable refer to a character inside someString, or is it a new independent char on it's own?
If it is not independent, how do I copy it?
If I do
string someString = "hello";
char c = someString[2];
does the c variable refer to a character inside someString, or is it a new independent char on it's own?
If it is not independent, how do I copy it?
cis a copy. If you wrotethen it would have been a reference.