C++ end1 error
When i type in the code in c++ then compile my work an error comes saying:
C:\My Documents\Cpp2.cpp(6) : error C2065: ''end1'' : undeclared identifier
what causes that and how should i fix it
Thunderstorm Games
Post some source code. You''ve either misspelled a variable/function reference as ''end1'', or you''ve forgotton to declare it. ->For Beginners
Wild guess - shouldnt it be endl instead of end1? The letter l instead of the number one?
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
This is the code im trying to put in:
#include <iostream>
using namespace std;
int main( void )
{
cout << " /\\ " << end1;
cout << " / \\ " << end1;
cout << " / \\ " << end1;
cout << " | | " << end1;
cout << " |[] [] |" << end1;
cout << " | |" << end1;
cout << " ----- " << end1;
return 0;
}
Thunderstorm Games
#include <iostream>
using namespace std;
int main( void )
{
cout << " /\\ " << end1;
cout << " / \\ " << end1;
cout << " / \\ " << end1;
cout << " | | " << end1;
cout << " |[] [] |" << end1;
cout << " | |" << end1;
cout << " ----- " << end1;
return 0;
}
Thunderstorm Games
Haha, yes, endl. (as in end line)
cout << "My text" << endl;
or even
cout << "My text\n";
/n is the newline character.
---
"May you live all the days of your life."
cout << "My text" << endl;
or even
cout << "My text\n";
/n is the newline character.
---
"May you live all the days of your life."
\n is not the same as endl in c++. endl flushes the buffer, but \n doesn''t (altough it does in plain c).
-Neophyte
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GED d- s:+ a- C++$ UL++ P++ L++ E W+ N+ o K? w !O M--(+) V-- PS+
PE Y+ PGP t-- 5++ X+ R(+) rv+(++) b+++ DI+ D(+) G e+>++ h r--> y+
----- END GEEK CODE BLOCK-----
geekcode.com
-Neophyte
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GED d- s:+ a- C++$ UL++ P++ L++ E W+ N+ o K? w !O M--(+) V-- PS+
PE Y+ PGP t-- 5++ X+ R(+) rv+(++) b+++ DI+ D(+) G e+>++ h r--> y+
----- END GEEK CODE BLOCK-----
geekcode.com
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement