Matt Roslevich escribió:
> I use MetroWorks CodeWarrior IDE on my computer at school, and I
> assumed that C++ compilers were all the same. I tried a simple
> program that works all the time on C++ and it failed on DEV C++ 5. It
> was a simple program that took i, which equaled 5, and incremented it
> using a for loop, until it hit 10, and then the loop stoped. But when
> I compiled it, the program said that cout and endl were un-defined
> identifiers and that <iostream.h> was not right? Why won't it work?
Well you shouldn't use headers in C++ that way, even with CodeWarrior.
It´s very advisable to use <iostream> (with/o .h) and tell the compiler
to use the standard name space, like this:
#include <iostream>
using namespace std;
...your code here
Cheers
|