Newbie question: C++ beginner question 
Author Message
 Newbie question: C++ beginner question

Hi my name is Mario,

I just started to programme in C++ today and i tried to do this small prog,
Hello Word!

// Hello world example
#include <iostream>
using namespace std;

int main()
{
cout << "Hello World!" << end1;
return 0;

Quote:
}

and when i compile it, it gives me the following erreur.

--------------------Configuration: Hello - Win32 Debug--------------------
Compiling...
Hello.cpp
D:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\MyProjects\Hello\Hello.cpp(7) :
error C2065: 'end1' : undeclared identifier
Error executing cl.exe.

Hello.exe - 1 error(s), 0 warning(s)

Can you tell me why and what`s the mistac.

Mario



Mon, 18 Jun 2001 03:00:00 GMT  
 Newbie question: C++ beginner question
 I think that's supposed to be endl with an L not a 1

HTH,
Mike

Quote:

>Hi my name is Mario,

>I just started to programme in C++ today and i tried to do this small prog,
>Hello Word!

>// Hello world example
>#include <iostream>
>using namespace std;

>int main()
>{
>cout << "Hello World!" << end1;
>return 0;
>}



Mon, 18 Jun 2001 03:00:00 GMT  
 Newbie question: C++ beginner question
    As Mike said, it's "endl" not "end1".  It's short for "END of Line".

--
Truth,
   James [MVP]
http://www.NJTheater.Com       -and-
http://www.NJTheater.Com/JamesCurran

Quote:

>// Hello world example
>#include <iostream>
>using namespace std;

>int main()
>{
>cout << "Hello World!" << end1;
>return 0;
>}

begin 666 James M. Curran.vcf


M4DLZ.SLQ."!*;VAN(%-T+"!3=6ET92 R0CM";&]O;69I96QD.TY*.S W,# S
M+34Q-#D-"DQ!0D5,.U=/4DL[14Y#3T1)3D<]455/5$5$+5!224Y404),13HQ
M."!*;VAN(%-T+"!3=6ET92 R0CTP1#TP04)L;V]M9FEE;&0L($Y*(# W,# S
M+34Q-#D-"E523#IH='1P.B\O=W=W+DY*5&AE871E<BYC;VTO2F%M97-#=7)R
M86X-"E523#IH='1P.B\O=W=W+DY*5&AE871E<BYC;VT-"D5-04E,.U!2148[
M24Y415).150Z2F%M97-#=7)R86Y 0V]M<'5397)V92YC;VT-"E)%5CHQ.3DY

`
end


Fri, 22 Jun 2001 03:00:00 GMT  
 Newbie question: C++ beginner question
You also need to add .h to the include line like this:

#include <iostream.h>

Quote:

>Hi my name is Mario,

>I just started to programme in C++ today and i tried to do this small prog,
>Hello Word!

>// Hello world example
>#include <iostream>
>using namespace std;

>int main()
>{
>cout << "Hello World!" << end1;
>return 0;
>}

>and when i compile it, it gives me the following erreur.
>--------------------Configuration: Hello - Win32 Debug--------------------
>Compiling...
>Hello.cpp
>D:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\MyProjects\Hello\Hello.cpp(7) :
>error C2065: 'end1' : undeclared identifier
>Error executing cl.exe.

>Hello.exe - 1 error(s), 0 warning(s)
>Can you tell me why and what`s the mistac.

>Mario



Sat, 23 Jun 2001 03:00:00 GMT  
 Newbie question: C++ beginner question

Quote:

>You also need to add .h to the include line like this:
>#include <iostream.h>

    You haven't been keeping up with the Standard, have you?  For at least
three years now, the official standard headers do not have any extension.
The ones with the .H remain only for backward compatibility, and may go away
in the next version of the standard (5 years from now)

--
Truth,
   James [MVP]
http://www.NJTheater.Com       -and-
http://www.NJTheater.Com/JamesCurran

begin 666 James M. Curran.vcf


M4DLZ.SLQ."!*;VAN(%-T+"!3=6ET92 R0CM";&]O;69I96QD.TY*.S W,# S
M+34Q-#D-"DQ!0D5,.U=/4DL[14Y#3T1)3D<]455/5$5$+5!224Y404),13HQ
M."!*;VAN(%-T+"!3=6ET92 R0CTP1#TP04)L;V]M9FEE;&0L($Y*(# W,# S
M+34Q-#D-"E523#IH='1P.B\O=W=W+DY*5&AE871E<BYC;VTO2F%M97-#=7)R
M86X-"E523#IH='1P.B\O=W=W+DY*5&AE871E<BYC;VT-"D5-04E,.U!2148[
M24Y415).150Z2F%M97-#=7)R86Y 0V]M<'5397)V92YC;VT-"E)%5CHQ.3DY

`
end



Sat, 23 Jun 2001 03:00:00 GMT  
 Newbie question: C++ beginner question
Nope.  There are versions of iostream with and
without the .h extension.  They are the older
and new versions, respectively.  Since the
#using namespace std was in there, the non-dot-h
version is appropriate. As others have said,
the problem is a "1" (numeral one) where
a "l" (letter l) is required.  It should be endl not end1.
--
Dan Evens
(Standard disclaimers etc. No spam please.)



Quote:
> You also need to add .h to the include line like this:

> #include <iostream.h>


> >Hi my name is Mario,

> >I just started to programme in C++ today and i tried to do this small
prog,
> >Hello Word!

> >// Hello world example
> >#include <iostream>
> >using namespace std;

> >int main()
> >{
> >cout << "Hello World!" << end1;
> >return 0;
> >}

> >and when i compile it, it gives me the following erreur.

> >--------------------Configuration: Hello - Win32

Debug--------------------

- Show quoted text -

Quote:
> >Compiling...
> >Hello.cpp
> >D:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\MyProjects\Hello\Hello.cpp(7) :
> >error C2065: 'end1' : undeclared identifier
> >Error executing cl.exe.

> >Hello.exe - 1 error(s), 0 warning(s)

> >Can you tell me why and what`s the mistac.

> >Mario



Sat, 23 Jun 2001 03:00:00 GMT  
 Newbie question: C++ beginner question


Fri, 19 Jun 1992 00:00:00 GMT  
 Newbie question: C++ beginner question
On Tue, 5 Jan 1999 16:13:03 -0500, "James Curran"

Quote:


>>You also need to add .h to the include line like this:
>>#include <iostream.h>

>    You haven't been keeping up with the Standard, have you?  For at least
>three years now, the official standard headers do not have any extension.

Why is that anyway?

Files without extensions always look like a mistake to me. What if
everybody created files without extensions? What a mess! After all we
don't all have resource forks and hidden type and creator codes like
Mac users.

I'm probably missing something obvious, but it seems like fixing what
ain't broke to me.

Quote:
>The ones with the .H remain only for backward compatibility, and may go away
>in the next version of the standard (5 years from now)

Don Grasberger
(remove --- from address to e-mail)


Sun, 24 Jun 2001 03:00:00 GMT  
 Newbie question: C++ beginner question
Quote:

> Files without extensions always look like a mistake to me. What if
> everybody created files without extensions? What a mess! After all we
> don't all have resource forks and hidden type and creator codes like
> Mac users.

Nothing says that the files themselves can't have extensions.
Just that they don't appear in the source code.  What makes
you assume that all systems use the same filename format.
Some don't really support the concept of .'s in filenames
or extensions at all.

By the way James is incorrect, the "*.h" are already outside
the existing standard (and 5 years isn't the revision cycle
anyhow).  Microsoft choses to leave them for backwards
compability, but that is outside the standard.



Sun, 24 Jun 2001 03:00:00 GMT  
 Newbie question: C++ beginner question

Quote:

>By the way James is incorrect, the "*.h" are already outside
>the existing standard (and 5 years isn't the revision cycle
>anyhow).

    Once a ISO standard is accepted, it cannot be changed for 5 years,
except for clarifications.  The committee is still active and hopes to have
a revised draft standard ready for approval once that prohibition is lifted.

--
Truth,
   James [MVP]
http://www.NJTheater.Com       -and-
http://www.NJTheater.Com/JamesCurran

begin 666 James M. Curran.vcf


M4DLZ.SLQ."!*;VAN(%-T+"!3=6ET92 R0CM";&]O;69I96QD.TY*.S W,# S
M+34Q-#D-"DQ!0D5,.U=/4DL[14Y#3T1)3D<]455/5$5$+5!224Y404),13HQ
M."!*;VAN(%-T+"!3=6ET92 R0CTP1#TP04)L;V]M9FEE;&0L($Y*(# W,# S
M+34Q-#D-"E523#IH='1P.B\O=W=W+DY*5&AE871E<BYC;VTO2F%M97-#=7)R
M86X-"E523#IH='1P.B\O=W=W+DY*5&AE871E<BYC;VT-"D5-04E,.U!2148[
M24Y415).150Z2F%M97-#=7)R86Y 0V]M<'5397)V92YC;VT-"E)%5CHQ.3DY

`
end



Mon, 25 Jun 2001 03:00:00 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Newbie question: Converting Borland C++ projects to Visual C++ 6.0

2. Newbie question: Converting Borland C++ Builder 5.0 projects to Visual C++ 6.0

3. beginners question in C/C++

4. Question about Visual C++ from the beginner.

5. Beginner's Visual C++ Question

6. Learning C on Microsoft C++ 6.0 (Standard Edition)-beginner has question

7. beginner C++ question

8. Beginner C++ question (debugging ...)

9. C++ beginner question about exception handling

10. beginner question on embedded C++ 3.0

11. array question - beginner question

12. C++ MFC ActiveX / VB Newbie question

 

 
Powered by phpBB® Forum Software