Error that isn't an error
Hi, I'm new to programming and I'm trying out some basic codes. I'm using Gedit as a text editor and g++ to compile in my CLI. I am learning basic i/o right now so I wrote this little code to try it out.
Code:
#include <iostream>
using namespace std;
int main ()
{
int age;
int zip;
age = 20;
zip = 50021;
cout << "I am " << age << " years old." endl;
cout << "My zipcode is " << zip << ".";
return 0;
}
I get this error message when I try to compile it:
Code:
[metatron@Babylon Desktop]$ g++ -o ioexp ioexp.cpp
ioexp.cpp: In function ‘int main()’:
ioexp.cpp:15: error: expected `;' before ‘endl’
I gather that it's telling me in line 15 I need a ";" before the "endl" command but firstly, I shouldn't need that right? It comes AFTER the "endl." And second, when I did try that I got another error anyway, which I expected.
Any ideas?