#include<stdio.h>
void write_stdin();
main()
{
write_stdin();
}
void write_stdin()
{
char input[256];
FILE *p1;
p1=fopen("ofile.txt","w");
while(gets(input))
{
p1.write(input);
}
fclose(p1);
}
I want to write to a file the input received on the standard input / command line on execution this is the error i get :
myprog1.cpp:17: error: request for member âwriteâ in âp1â, which is of non-class type âFILE*â

New Topic/Question
Reply



MultiQuote



|