| CheesyBeefy (80) | |
I undesrstand (I think) that when used '\', it cancels out whatever comes after it. Now, for my menu in my C++ Console App, I need to use this '\' in a cout statement. More specifically: cout << "/------------------------------\"; but it doesn't register the ending " because the '\' is in front of it. Is there any way around this?
| |
|
|
|
| firedraco (5413) | |
|
It doesn't do that exactly. It is the specifier for 'special' characters, i.e.: \n = newline \b = beep \" = " etc.. To put a normal \, use \\. | |
|
|
|
| LacViet (82) | |||
Add in another \. Like.
[EDIT] Woops. I was late...lolz. | |||
|
Last edited on
|
|||
| CheesyBeefy (80) | |
|
Thanks, works perfectly. =] Also, in VC++ 2008, isn't it \a for a beep? \b does nothing. :P | |
|
|
|
| Bazzy (6281) | |
|
Read http://www.cplusplus.com/doc/tutorial/constants.html at Character and string literals section, there you could find some escape characters | |
|
|
|
| monere (1) | |
|
Hello, I tried your solution with the follwing system instruction, but it did not work. i got an errror statement indicating that the \w was not an escape character. system("ProgramFiles%\\Windows NT\\Accessories\\wordpad.exe"); can you help me ? monere | |
|
|
|
| Fredbenz (33) | |
You missed a %.system("%ProgramFiles%\\Windows NT\\Accessories\\wordpad.exe");
| |
|
Last edited on
|
|