please help, when i compile the following code i get errors not sure what they mean though. very new to Linux and C++
[tony@jstlinbox c]$ gcc ccode.cpp -o myoutputccode
ccode.cpp: In function `int main()':
ccode.cpp:11: `cout' undeclared (first use this function)
ccode.cpp:11: (Each undeclared identifier is reported only once for each
function it appears in.)
[tony@jstlinbox c]$
The tougher it gets the more you learn! The more you learn the tougher it gets!
Code:
#include <iostream>
int main ()
{
int localVar = 5;
int * plocal = &localVar;
int * pheap = new int;
*pheap = 7;
cout << "localVar: " << localVar << "\n";
cout << "plocal: " << plocal << "\n";
cout << "pheap: " << pheap <<"\n";
delete pheap;
pheap = new int;
*pheap = 9;
cout << "pheap: " << pheap <<"\n";
delete pheap;
return 0;
}
[tony@jstlinbox c]$ gcc ccode.cpp -o myoutputccode
ccode.cpp: In function `int main()':
ccode.cpp:11: `cout' undeclared (first use this function)
ccode.cpp:11: (Each undeclared identifier is reported only once for each
function it appears in.)
[tony@jstlinbox c]$
The tougher it gets the more you learn! The more you learn the tougher it gets!