Error
I know this is dumb but i cant figure out whats wrong. I type this into VC++ 6 and get the error : error C2065: 'endl' : undeclared identifier.
#include <iostream>
int main()
{
int x = 5;
int y = 7;
std::cout << endl;
std::cout << x + y << " " << x * y;
std::cout << endl;
return 0;
}
Any help for a noob C++ programer.
Still not working typed
#include <iostream>
using namspace std;
int main()
{
int x = 5;
int y = 7;
std::endl;
std::cout << x + y << " " << x * y;
std::endl;
return 0;
}
#include <iostream>
using namspace std;
int main()
{
int x = 5;
int y = 7;
std::endl;
std::cout << x + y << " " << x * y;
std::endl;
return 0;
}
Actually, I meant
#include <iostream>int main(){int x = 5;int y = 7;std::cout << std::endl;std::cout << x + y << " " << x * y;std::cout << std::endl;return 0;}
I would also like to point out that if you use KrazeIke's post, it will work as is without the namespace I mentioned after him.
This works fine for me in VS6 -
That is an alternative though.
- Drew
This works fine for me in VS6 -
#include <iostream>int main(){ int x = 5; int y = 7; std::cout << std::endl; std::cout << x + y << " " << x * y; std::cout << std::endl; return 0;}
#include <iostream>using namespace std;int main(int argc, char* argv[]){ int x = 5; int y = 7; cout << endl << x + y << " " << x * y << endl; return 0;}
That is an alternative though.
- Drew
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement