im a noob at c++, do you think so?

This is a discussion on im a noob at c++, do you think so? within the C++ Programming forums, part of the General Programming Boards category; i cannot figure out why this keeps happening when I compile BEL-RASHOs-MacBook-Pro esktop belrasho$ g++ lab10.cpp -o lab10 lab10.cpp:1: error: ...

  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    3

    im a noob at c++, do you think so?

    i cannot figure out why this keeps happening when I compile


    BEL-RASHOs-MacBook-Proesktop belrasho$ g++ lab10.cpp -o lab10
    lab10.cpp:1: error: stray \ in program
    lab10.cpp:1: error: stray \ in program
    lab10.cpp:1: error: stray \ in program
    lab10.cpp:1: error: stray \ in program
    lab10.cpp:1: error: stray \ in program
    lab10.cpp:2: error: stray \ in program
    lab10.cpp:2: error: stray \ in program
    lab10.cpp:2: error: stray \ in program
    lab10.cpp:2: error: stray \ in program
    lab10.cpp:3: error: stray \ in program
    lab10.cpp:3: error: stray \ in program
    lab10.cpp:3: error: stray \ in program
    lab10.cpp:3: error: stray \ in program
    lab10.cpp:4: error: stray \ in program
    lab10.cpp:4: error: stray \ in program
    lab10.cpp:4: error: stray \ in program
    lab10.cpp:4: error: stray \ in program
    lab10.cpp:4: error: stray \ in program
    lab10.cpp:5: error: stray \ in program
    lab10.cpp:6: error: stray \ in program
    lab10.cpp:6: error: stray \ in program
    lab10.cpp:6: error: stray \ in program
    lab10.cpp:6: error: stray \ in program
    lab10.cpp:8: error: stray \ in program
    lab10.cpp:8: error: stray \ in program
    lab10.cpp:8: error: stray \ in program
    lab10.cpp:8: error: stray # in program
    lab10.cpp:8:34: warning: backslash-newline at end of file
    lab10.cpp:8: error: stray \ in program
    lab10.cpp:8: error: stray \ in program
    lab10.cpp:8: error: stray \ in program
    lab10.cpp:8: error: stray \ in program
    lab10.cpp:1: error: expected unqualified-id before { token
    BEL-RASHOs-MacBook-Proesktop belrasho$

  2. #2
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,655
    What are you using to edit your code? Show us the first line of your lab10.cpp file.

  3. #3
    Registered User
    Join Date
    Feb 2003
    Posts
    595
    Just as a wild guess, did you use a word processor (as opposed to a text editor) to write your code?

  4. #4
    Registered User
    Join Date
    Apr 2010
    Posts
    3
    I am using text editor on my macbrook pro.

    the first line of my file is #include<iostream>


    so far, i have figured out that the text editor is adding '/' for why? i dont know.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,822
    Post your code as an attachment perhaps?

    Also, if your editor has commands for "bold", "italic" etc, then it is a word processor, not a text editor.
    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.

  6. #6
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,655
    You mean TextEdit? What format are you saving the file as?

  7. #7
    Registered User
    Join Date
    Apr 2010
    Posts
    3
    thanks to everyones' effort. after hours of research, I have figured out a soultion to my problem.

    text editor was inserting invisible and non removable characters '/' into my code.

    By downloading textwrangler, it saved all my codes as a uTF-8 no bom.

    GO TO DOWNLOADS.COM to get textwrangler. I suggest using it instead of texteditor.

    Im a mac user

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Noob needs help :)
    By Cursius in forum C++ Programming
    Replies: 4
    Last Post: 12-11-2009, 04:19 PM
  2. Noob in need of help.
    By gec5741 in forum C++ Programming
    Replies: 18
    Last Post: 01-23-2009, 03:25 PM
  3. my noob program doesnt work
    By Scarvenger in forum C++ Programming
    Replies: 2
    Last Post: 10-19-2005, 12:40 PM
  4. noob needs help!!!!:(
    By tykenfitz in forum C Programming
    Replies: 1
    Last Post: 07-10-2005, 09:49 AM
  5. simple noob question: HWND, HDC etc.
    By freedik in forum Windows Programming
    Replies: 12
    Last Post: 08-19-2003, 04:59 AM

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