At Tue, 7 Oct 2008 08:50:41 -0700 (PDT) Randy AC7NJ <[EMAIL PROTECTED]> wrote:
>
> the error I get is
> myfirst.c:5: error: 'cout' was not declared in this scope
>
> / / myfirst.c --displays a message
> #include <iostream>
> int main(void)
> {
> cout << "come up and C++ me sometime.";
> cout << "\n";
> return 0;
> }
>
>
You need to 'use' the std namespace, either with a 'using' statement:\
using namespace std;
Or else you need to qualify the cout references:
std::cout
Eg:
// myfirst.c --displays a message
#include <iostream>
int main(void)
{
std::cout << "come up and C++ me sometime.";
std::cout << "\n";
return 0;
}
--
Robert Heller -- Get the Deepwoods Software FireFox Toolbar!
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
[EMAIL PROTECTED] -- Contract Programming: C/C++, Tcl/Tk
_______________________________________________
help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus