sjesweak Posted February 1, 2004 Posted February 1, 2004 I've 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*? Quote
HJB417 Posted February 2, 2004 Posted February 2, 2004 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.