473,382 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Strings

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");
Nov 17 '05 #1
4 1228
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.
"Reza A" <re*****@sbcglobal.net> wrote in message
news:dV*******************@newssvr27.news.prodigy. com...
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");

Nov 17 '05 #2
The book doesn't cover anything of that sort, so I dont know what you're
talking about. Care to explain some more?

<.> wrote in message news:um**************@TK2MSFTNGP11.phx.gbl...
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.
"Reza A" <re*****@sbcglobal.net> wrote in message
news:dV*******************@newssvr27.news.prodigy. com...
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");


Nov 17 '05 #3
On Thu, 19 Feb 2004 08:58:49 GMT, Reza A wrote:
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");


The S means that it is a string literal which can provide a boost in
performance. See:

http://msdn.microsoft.com/library/de...sSpec_11_2.asp

for details.

Tim
--
Tim Smelser - MVP Visual C#
To email me, make the snot hot.
Nov 17 '05 #4
Reza A <re*****@sbcglobal.net> wrote:
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

--
Sp******@gmx.de is never read
I'm Schobi at suespammers dot org

"Sometimes compilers are so much more reasonable than people."
Scott Meyers
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Ravi | last post by:
Hi, I have about 200GB of data that I need to go through and extract the common first part of a line. Something like this. >>>a = "abcdefghijklmnopqrstuvwxyz" >>>b = "abcdefghijklmnopBHLHT"...
17
by: Gordon Airport | last post by:
Has anyone suggested introducing a mutable string type (yes, of course) and distinguishing them from standard strings by the quote type - single or double? As far as I know ' and " are currently...
16
by: Paul Prescod | last post by:
I skimmed the tutorial and something alarmed me. "Strings are a powerful data type in Prothon. Unlike many languages, they can be of unlimited size (constrained only by memory size) and can hold...
4
by: agent349 | last post by:
First off, I know arrays can't be compared directly (ie: if (arrary1 == array2)). However, I've been trying to compare two arrays using pointers with no success. Basically, I want to take three...
25
by: Rainmaker | last post by:
Hi, Can anyone tell me an efficient algorithm to sort an array of strings? Keep in mind that this array is HUGE and so the algorithm should me efficient enough to deal with it. Thanks
6
by: Broeisi | last post by:
Hello, I wrote the tiny progam below just to understand arrays and strings better. I have 2 questions about arrays and strings in C. 1. Why is it that when you want to assign a string to an...
2
by: Potiuper | last post by:
Question: Is it possible to use a char pointer array ( char *<name> ) to read an array of strings from a file in C? Given: code is written in ANSI C; I know the exact nature of the strings to be...
19
by: pkirk25 | last post by:
I wonder if anyone has time to write a small example program based on this data or to critique my own effort? A file called Realm List.html contains the following data: Bladefist-Horde...
95
by: hstagni | last post by:
Where can I find a library to created text-based windows applications? Im looking for a library that can make windows and buttons inside console.. Many old apps were make like this, i guess ...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.