Advertisement

C++ end1 error

Started by May 19, 2002 10:02 AM
5 comments, last by Gamer1443 22 years, 7 months ago
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
Advertisement
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
end1 has to be endl;

I will spell it out, to make sure.

E - N - D - L - ;
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."
Advertisement
\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

This topic is closed to new replies.

Advertisement