0

I'm just starting to learn C++, so bear with me please. I've started with a a simple example problem copied out of a book, and I've checked and re-checked several times to make sure the code is identical. The code is:

#include <iostream>
int main()
{
     int x = 5;
     int y = 7;
     std::cout << endl;
     std::cout << x + y << " " << x * y;
     std::cout << end;
     return 0;
}

I've tried to compile using Dev-C++ version 4.9.8.0, and it keeps highlighting that one section of code that is blue. I tried changing a couple simple things, but since I'm just starting to code I don't really know what I'm doing. Can someone please help me out? Thanks.

3
Contributors
3
Replies
4
Views
11 Years
Discussion Span
Last Post by gorgonzola357
0

You may also need to pause the program to see the results...

#include <iostream>
int main()
{
     int x = 5;
     int y = 7;
     std::cout << std::endl;
     std::cout << x + y << " " << x * y;
     std::cout <<std::endl;
     
     std::cin.get();
     return 0;
}
0
std::cout << std::endl;

Of course! I forgot that I had to put the 'std::' code after every, um, code thingy. I'm going to try and use 'using namespace std;' for now so I don't forget to put those individual codes everywhere.

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.