S"String"

sjesweak

Member
Joined
Feb 1, 2004
Messages
5
Ive been looking at chunks of code and dealing with string assignments in C++.

String* myLog = S"myNewLog";

What is the S before "myNewLog"; needed for? Is it involved with the pointer of String*?
 
it tells the compiler to treat it as a System.String as opposed to an array of characters.

"foo bar" = char value[] = {f, o, o, , b, a, r, \0};
String* value = "foo bar" //wont compile
String* value = new String("foo bar") // will compile
String* value = S"foo bar" //will compile

and you can do S"FOO BAR"->Substring() and so forth.
 
Back
Top