Stray 7? Waaaaaaaaa?

This is a discussion on Stray 7? Waaaaaaaaa? within the C++ Programming forums, part of the General Programming Boards category; I added some code, and i got Code: C:\Users\Matt\Desktop\Projects\fincal2\fincal2Main.cpp|219|error: stray '7' in program| so i commented it all out, but ...

  1. #1
    Registered User Terran's Avatar
    Join Date
    May 2008
    Location
    Nashua, NH
    Posts
    100

    Stray \127? Waaaaaaaaa?

    I added some code, and i got
    Code:
    C:\Users\Matt\Desktop\Projects\fincal2\fincal2Main.cpp|219|error: stray '\127' in program|
    so i commented it all out, but i still get it, what's going on? What does that even mean!?
    Sorry, but i'm a Code::Blocks man now.

  2. #2
    Registered User Terran's Avatar
    Join Date
    May 2008
    Location
    Nashua, NH
    Posts
    100
    anybody?
    Sorry, but i'm a Code::Blocks man now.

  3. #3
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,145
    Did you by any chance copied and pasted the file through a terminal? I got the same problem when I copied my code through putty (ssh client for windows). No idea why. I just stopped doing it.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,341
    One common way is to copy/paste HTML code into your editor.

    Anyway, look very carefully at the indicated line. Delete any space and replace it with a real space (for example). Also look for " " marks which slope in either direction.
    A hex editor is ideal for this, as any source code should contain only 0x20 to 0x7E + 0x09 (tab) 0x0a (linefeed) or 0x0d (newline)
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I think there's a bug in that error message! \127 (octal) is 87 decimal - so a W.

    I suspect it's actually referring to a "delete" character, ascii decimal 127.

    Otherwise the above comments are correct - use hex editor or some editor that can display "funny" characters. (emacs is quite capable of this for example).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Stray Error while compiling
    By Mankthetank19 in forum C Programming
    Replies: 6
    Last Post: 02-03-2011, 02:24 PM
  2. What does: 'error: stray \357 in program' mean?
    By Phanixis in forum Linux Programming
    Replies: 8
    Last Post: 12-04-2010, 12:48 AM
  3. "Nearest value" algorithm?
    By Boxknife in forum C Programming
    Replies: 10
    Last Post: 06-26-2009, 11:42 PM
  4. gcc -c error
    By Tommo in forum Linux Programming
    Replies: 3
    Last Post: 06-22-2007, 03:15 PM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21