Maybe I'm missing something, but this works in C++.
PHP Code:FILE* file_in;
char test[256];
file_in = stdin;
fgets(test,256,file_in);
printf("%s",test);
file_in = fopen("file.txt","r");
fgets(test,256,file_in);
printf("%s",test);
fclose(file_in);
|
Results 1 to 3 of 3
Thread: stdin or a fileThreaded View
|
Click Here to Expand Forum to Full Width |