C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 15th, 2005, 08:25 PM
BloodlustShaman BloodlustShaman is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Location: in earth
Posts: 176 BloodlustShaman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 Days 12 h 13 m 30 sec
Reputation Power: 14
Send a message via Yahoo to BloodlustShaman
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

Reply With Quote
  #2  
Old September 15th, 2005, 10:06 PM
B-Con's Avatar
B-Con B-Con is offline
:bcon: moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Location: int main()
Posts: 351 B-Con User rank is Private First Class (20 - 50 Reputation Level)B-Con User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 23 h 24 m 9 sec
Reputation Power: 14
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.
Comments on this post
MichaelSoft agrees: cout&lt;&lt;" | \\ | / | \\ | / |\n";
__________________
Officially a member of the Itsacon fan club. Beer blasts are every friday at Viper_SB's house. I bring the chips.



Reply With Quote
  #3  
Old October 1st, 2005, 03:28 PM
BloodlustShaman BloodlustShaman is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Location: in earth
Posts: 176 BloodlustShaman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 Days 12 h 13 m 30 sec
Reputation Power: 14
Send a message via Yahoo to BloodlustShaman
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

Reply With Quote
  #4  
Old October 1st, 2005, 09:20 PM
Geo.Garnett's Avatar
Geo.Garnett Geo.Garnett is offline
Registered Loser
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Location: Retardation Nation...
Posts: 347 Geo.Garnett User rank is Private First Class (20 - 50 Reputation Level)Geo.Garnett User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 Days 3 h 13 m 45 sec
Reputation Power: 14
Send a message via AIM to Geo.Garnett
Quote:
cout<<" | \\ | / | \\ | / |\n";

Thats nothing "&lt" stands for < and "&quot" stands for "
nothing big though Its a code mess up..

Reply With Quote
  #5  
Old October 1st, 2005, 09:27 PM
BloodlustShaman BloodlustShaman is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Location: in earth
Posts: 176 BloodlustShaman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 Days 12 h 13 m 30 sec
Reputation Power: 14
Send a message via Yahoo to BloodlustShaman
thanks
geo

Reply With Quote
  #6  
Old October 1st, 2005, 11:24 PM
Geo.Garnett's Avatar
Geo.Garnett Geo.Garnett is offline
Registered Loser
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Location: Retardation Nation...
Posts: 347 Geo.Garnett User rank is Private First Class (20 - 50 Reputation Level)Geo.Garnett User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 Days 3 h 13 m 45 sec
Reputation Power: 14
Send a message via AIM to Geo.Garnett
NP Buddie

Reply With Quote
  #7  
Old October 2nd, 2005, 04:05 AM
Itsacon's Avatar
Itsacon Itsacon is offline
Command Line Warrior
Click here for more information
 
Join Date: Aug 2004
Location: Sector ZZ9 Plural Z Alpha
Posts: 1,029 Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6
Time spent in forums: 1 Week 12 h 55 m 59 sec
Reputation Power: 16
Send a message via ICQ to Itsacon
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: 592

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > an unusual warning


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap