0
I didn't understand the concept strings
5 Respuestas
+ 4
Strings are written in quotation marks => one indicates starting of string and another one for end of string.
Suppose you want to use " in your string for example
printf("Nice to "help" you");
Compiler will understand that you want to end string and will end it at beggining of help.
So to include quotation mark in your string you have to use special character called back slash (\).
It will tell compiler to consider it as special case and not end string , just add it to string.
printf("Nice to \"help\" you");
Hope this explanation helps☺️☺️.
+ 1
Okay thank you. Why do we use backslash in strings in python and when we use it
+ 1
Back slashes are known as escape sequences/characters and are used for special purposes.. For ex.. you need a new line in a String..so you can add\n for a new line.. other characters:
\ (a-Alarm,b- Backspace,t-horizontal tab..etc.. check Python documentation..)
and \\for adding a backslash in a String.. They are present because you cannot do these operations directly by keyboard (or are difficult)..
Hope this helps
0
string is use for words or sentences in other meaning to store more than one charecter.
String is array of charecters.
0
https://msdn.microsoft.com/en-us/library/6aw8xdf2.aspx
if you mean \n see the link.
\n means new line .
or if you mean // or / this is use to show the path to file.