Re: [Dev-C++] Errors reported in perfect code!
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Jason H. <jas...@bt...> - 2001-10-21 22:36:07
|
You are getting those errors because cout is part of the <iostream> header.
<stdio> is used in C as opposed to C++ and the equivalent would be to use
printf(...)
Just add:
#include <iostream>
at the top.
Jason.
----- Original Message -----
From: "Christiaan Scholtz" <ck...@ia...>
To: <dev...@li...>
Sent: Sunday, October 21, 2001 11:17 PM
Subject: [Dev-C++] Errors reported in perfect code!
> This for example:
>
> #include <stdio.h>
>
> int main(int argc, char *argv[])
> {
> cout >> "hey";
> return 0;
> }
>
> gives :
>
> c:\mydocu~1\untitl~1.cpp: In function `int main(int, char **)':
>
> c:\mydocu~1\untitl~1.cpp:5: `cout' undeclared (first use this function)
>
> c:\mydocu~1\untitl~1.cpp:5: (Each undeclared identifier is reported only
> once
>
> c:\mydocu~1\untitl~1.cpp:5: for each function it appears in.)
>
>
>
> Whats going on here? I also get diffrent messages for larger code with
> nothing wrong with it.
>
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|