• No replies
196 Posts

Pinned topic Getting "cannot convert int to FILE *" error message

‏2010-05-09T06:05:16Z |

Hi All,

I am getting the following error message while running the below given code snippet with xlC v8 compiler on AIX 5.3.

Error: Cannot convert int to FILE *


using namespace std;
int main()
int fdd;
ofstream ofs;
if(fdd == -1 )
cout<<"failed";<br />
return 0;
The same code works with non-standard headers fstream.h and iostream.h but with standard headers it is not working. Does anybody has any idea how to resolve this error with standard headers?
Thanks in advance,

Updated on 2010-05-10T01:13:19Z at 2010-05-10T01:13:19Z by vijayka
  • vijayka
    2 Posts

    Re: Getting "cannot convert int to FILE *" error message


    It seems that fstream is defines fdd() to return FILE * type that gets picked up from yvals.h where _Filet is defined as FILE.
    I think using fstream.h and iostream.h is the best alternative as I checked this in version 10.1 of XLC compiler.