Thread: Help!!!

  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,823
    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
Website Security Test