i was just hoping someone could help me with a small problem..i'm using windows xp os...whenever i compile a c++ prog.
there is an error message like "unable to open include file 'iostream.h"i tried to use iostream also.but it didn't solve.what to do.. any suggestions..
|
I'm not familair with turbo3. However, there should be a include folder inside it. You could check or iostream is inside it.
Its normale to use iostream instead of iostream.h. Also, to access functions inside it, you need to make clear you are trying to access something in the 'standard namespace'. You can do this by writing "std::" before every cout, or add this right after the include statements: usingnamespace std; .
Try to compile this and if it doesnt work, post the errors you get:
#include <iostream>
usingnamespace std; //tell the compiler you're using the standard namespace
int main()
{
int n=5; //you can declare i and j later
for(int i=1;i<=n;i++)
{
for(int j=1;j<=2*i-1;j++)
{
cout<<'*';
} // I would recommend to always use '{}' to avoid mistakes
cout<<endl;
}
cin.ignore(); //pause the program before ending
return 0; //return 0
}