-
Problem
i need help with this code. I know it is very basic and even explained in the tutorials but when i write it myself there is an error. here is code
Code:
#include <iostream>
using namespace std;
int main()
{
for (int x = 0; x < 11; x++ ) {
cout<< x <<end1;
}
cin.get();
}
i just cant find what is wrong with it. I copied/pasted the tutorial code which worked fine but this wont work. the error that comes is saying 'end1' is not undeclared. when i do int end1; it at least starts but doesnt do what its supposed to. please help as i am still new.
-thanks in advance
-
end1 is a typo, it should be endl, with a lower case L. endl is a manipulator that stands for "end line".
-
its end L not end 1
Code:
//right way
cout <<endl;
//wrong way
cout <<end1;
see the difference?
-
-
In the future, stating the problem you are having is a more effective way of getting results.