0

Hey, I'm new to programming in C++

So I just got done writing this and everything seems fine to me, but I got an errors. I've had many problems with compilers in the past, but I'm not sure if this is from the code or the compiler.

If it helps I'm running Windows7 64bit and using DevC++ (mingw)

#include <iostream>
using namespace std;

int main ()
{

int a;
int b;

cout << "lets add numers, enter you first number";
cin >> a;
cout << "enter your second number";
cin >> b;
cout >> (a + b);

return 0;
}

This is the problem

\test.cpp In function `int main()':
\test.cpp no match for 'operator>>' in 'std::cout >> (a + b)'
\Makefile.win [Build Error] [test.o] Error 1

I've scanned through it many times, but I still cant figure out whats wrong. Did I do anything wrong?

I found out what I did wrong, you can go ahead and delete this ^_^

Edited by NickRx: n/a

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by Nick Evan
0

you're using the wrong operator. Use cout << instead of cout >>

Yeah, already seen and fixed this.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.