Strings

  • Thread starter Thread starter Reza A
  • Start date Start date
R

Reza A

Can anyone explain why when Visual Studio creates code that has to use
strings it puts a S before every string?
Example

System::Console::WriteLine(S"Hello World");
 
S is a .NET string, right?

Wheras L is wide.

Dont ya love this "feature" of C++.

There are 354893258237598584584 types of strings. Pick your poison.
 
The book doesn't cover anything of that sort, so I dont know what you're
talking about. Care to explain some more?
 
Reza A said:
The book doesn't cover anything of that sort, so I dont know what you're
talking about. Care to explain some more?

Is it a book on Managed C++?
This
System::Console::WriteLine(S"Hello World");
seems to be what's called MC++. If
your book is on std C++, you won't
find this in there. In that case
you should decide what you want to
learn and either (a) don't use MC++
or (b) buy a book on MC++.

FWIW, in std C++ you do this instead:
std::cout << "Hello, World!";

Schobi

--
(e-mail address removed) is never read
I'm Schobi at suespammers dot org

"Sometimes compilers are so much more reasonable than people."
Scott Meyers
 
Back
Top