Help!!!

This is a discussion on Help!!! within the C++ Programming forums, part of the General Programming Boards category; Hey guys, I am new here and I am also new to computer programing in general. Anyways I am having ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    10

    Unhappy Help!!!

    Hey guys,
    I am new here and I am also new to computer programing in general. Anyways I am having trouble with a line in my program:

    cout << '\n' << setw(3) <<num2+2;

    The following error comes up in the compiler:

    Warning ASP3_1.CPP 17: Ambiguous operators need parentheses in function main()

    I totally confused at this point, anybody please help.

    Tony.


    P.S. Can anybody recommend a good book about c++ for newbies, my college text book sucks.

  2. #2
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,825
    Put your num2+2 in parens.

    > P.S. Can anybody recommend a good book about c++ for newbies, my college text book sucks.

    firstpod.tripod.com/cpp21

  3. #3
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    Precidence of the overloaded operaters don't change, that's why it
    might seem a little odd.

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    10

    Talking Thanx

    Thanx guys, a million.


    Tony.

Popular pages Recent additions subscribe to a feed

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