User forums > Using Code::Blocks

need help understanding

(1/1)

overseer16:
hey i need help understanding why this doesn't work. im learning from my C++ for dummies and just tryed the mynumber thing and thought this would work but seems like it hasn't my program reads:

#include <iostream>

using namespace std;

int main()
{
    int tom, dick, harry;
    tom = 10;
    dick = 20;
    harry = 3254;
 
    return 0;
}

it should go 10, 20, 3254 when i build it right? yet i get the error for the   cout << tom, dick, harry << endl;  line saying error: invalid operands of types `int' and `<unknown type>' to binary `operator<<'|

Jenna:
Wrong forum (and wrong website).
Please ask in a c++-forum.
Your post violates one of our forum rules (only C::B related questions allowed).

Topic locked !

Navigation

[0] Message Index

Go to full version