| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
an unusual warning
So I was doing some stuff when then i decide to see the stuff run. But when i compile it it gives me this warning
[Warning] '\040' But somebody like me doesn't understand this and I tried to search this warning and all i got was junk. And I also compile it in Borland to see if I get the same thing and I don't get that warning I don't get any warning in the line, but with DevC-++ i get that warning and even though it may not be a big deal I still want to take it away. Heres a part I have the warning on Code:
cout<<" | \ | / | \ | / |\n"; This is wierd cause it gives me two warnings and its the same thing and in the same place Heres the code where it came from Code:
cout<<" 21-----22-----23-----24-----25\n"; cout<<" | \ | / | \ | / |\n"; cout<<" | \ | / | \ | / |\n"; cout<<" | \ | / | \ | / |\n"; cout<<" 16-----17-----18-----19-----20\n"; cout<<" | / | \ | / | \ |\n"; cout<<" | / | \ | / | \ |\n"; cout<<" | / | \ | / | \ |\n"; cout<<" 11-----12-----13-----14-----15\n"; cout<<" | \ | / | \ | / |\n"; cout<<" | \ | / | \ | / |\n"; cout<<" | \ | / | \ | / |\n"; cout<<" 6----- 7------8----- 9----- 10\n"; cout<<" | / | \ | / | \ |\n"; cout<<" | / | \ | / | \ |\n"; cout<<" | / | \ | / | \ |\n"; cout<<" 1----- 2----- 3----- 4 ----- 5\n\n"; If you want to see the other part of the code then just ask so Also whats wierd is that it shows on everysingle line two times exept for the first cout, it shows no warnings at all. Also everywarning directs me to the 7th place always cout<<(here is where it claims to have the problem)" | \ | / | \ | / |\n"; Also if this warning is cannot be taken away say so. Also I just want to know how this warning came to be. In other words how did I got this warning. plz reply Things so you will not waste posting: No the program is not finish. But I will not add anymore code that will change the line.(well I was not thinking of) No this is not the only warning I have with the program |
|
#2
|
||||
|
||||
|
The warning is because of your backslashes. Whenever you use a backslash in a litteral string, it is interpreted to signify the presence of an escape character (such as "\n"). If the following character after the backslash is not one of the valid escape characters (which, in your case, is a space, ' '), then the compiler gets angry at you
Just place an additional backslash before all your backslashes in your strings, so that the first backslash indicates an escape character and the second one indicates that the escape character to display is actually a backslash.
__________________
Officially a member of the Itsacon fan club. Beer blasts are every friday at Viper_SB's house. I bring the chips. ![]() |
|
#3
|
|||
|
|||
|
Wow thanks I did not had the chance to try it out sooner (cause of school) but I did now and it has no /040 warning so thanks but I cant say it works as I want it to cause I still got other problems but thanks for that now I know.
Also whats cout<<" | \\ | / | \\ | / |\n"; All I did was add a backlash like in top not all that So yeah thanks for the help. Even though now I will try easier things I will but this as one of my future projects and for now I wont try to make this but for now Ill do easier projects but still thanks for the help ![]() |
|
#4
|
||||
|
||||
|
Quote:
Thats nothing "<" stands for < and """ stands for " nothing big though Its a code mess up.. |
|
#5
|
|||
|
|||
|
thanks
geo |
|
#6
|
||||
|
||||
|
NP Buddie
![]() |
|
#7
|
||||
|
||||
|
If you're wondering at the \040 error code, 040 is C's way of saying 'Octal value 40', which is the ASCII space character. (hex 20 or decimal 32)
in effect it's telling you \<space>
__________________
This is my code. Is it not nifty? "The biggest problem encountered while trying to design a system that was completely foolproof, was, that people tended to underestimate the ingenuity of complete fools." ---Douglas Adams Join the Itsacon fanclub! Zero Tolerance: Spammers banned so far: 280
![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > an unusual warning |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|