Top "String-literals" questions

String literals concern the syntactic representation of literal constant strings in C and C++.

python: SyntaxError: EOL while scanning string literal

I have the above-mentioned error in s1="some very long string............" Does anyone know what I am doing wrong?

python string string-literals
C++ multiline string literal

Is there any way to have multi-line plain-text, constant literals in C++, à la Perl? Maybe some parsing trick with #includeing …

c++ string-literals
Windows path in Python

What is the best way to represent a Windows directory, for example "C:\meshes\as"? I have been trying to …

python path string-literals
Difference between string object and string literal

What is the difference between String str = new String("abc"); and String str = "abc";

java string string-literals
What does the symbol \0 mean in a string-literal?

Consider following code: char str[] = "Hello\0"; What is the length of str array, and with how much 0s it is …

c++ c string escaping string-literals
Single quotes vs. double quotes in C or C++

When should I use single quotes and double quotes in C or C++ programming?

c++ c syntax char string-literals
How to add percent sign to NSString

I want to have a percentage sign in my string after a digit. Something like this: 75%. How can I have …

objective-c nsstring string-literals
How can I get double quotes into a string literal?

I have the following output created using a printf() statement: printf("She said time flies like an arrow, but fruit …

c++ c string escaping string-literals
String in function parameter

int main() { char *x = "HelloWorld"; char y[] = "HelloWorld"; x[0] = 'Z'; //y[0] = 'M'; return 0; } In the above program, HelloWorld will be …

c gcc string-literals function-parameter
How to use Macro argument as string literal?

I am trying to figure out how to write a macro that will pass both a string literal representation of …

c++ c-preprocessor string-literals