Symbols within strings.

I can't seem to find any information how to force quotations to be printed as symbols within a string. For example if I have this piece of code:
string Line3 = "<A id="top"></A>"
Is it possible to force everything between the two outside quotes to be printed? Currently it tries to split it into two sections with the word top excluded. The purpose of this is to feed the string into a prinf() somewhere else in the code.
How about:
string someString = "some text...bla bla bla \"something\" and more text...";
Hmmm that seems to work quite well what does the \ do exactly I've never seen it used before?
Well...I don't know. I read in some book that isf you want to put " " signs you have to put \before. You have also, \n (newline), \0 (endofstring),\t (tab), and other stuff...look it up in basics. I forgot everything!!! :(
Ok thanks for your help.
The backslash is used for two purposes.

First, it gives special meaning to an otherwise ordinary character. '\n' for instances is the carriage return which you can add to a string. n alone is simply the character n. Add the preceding backslash and it becomes a carriage return.

Second, it removes special meaning from other characters such as the \ itself or the ". You see, " is used by the compiler to understand where your string starts and stops. If you want an embedded " you have to precede it with the '\' to prevent the compiler from thinking that this is the end of a string. If you wanted to embed the \ within a string such as in a path to a directory you need to do this \\. This escapes the special meaning of the \ so that it is treated as simply the \ character.
Topic archived. No new replies allowed.