prog.cpp:1:10: error: #include expects "FILENAME" or <FILENAME>
#include stdio.h
^
prog.cpp:2:10: error: #include expects "FILENAME" or <FILENAME>
#include stdlib.h
^
prog.cpp: In function ‘int main()’:
prog.cpp:6:1: error: ‘FILE’ was not declared in this scope
FILE *outputFile;
^
prog.cpp:6:7: error: ‘outputFile’ was not declared in this scope
FILE *outputFile;
^
prog.cpp:10:68: error: ‘printf’ was not declared in this scope
printf("This program saves your console input to an output file.\n");
^
prog.cpp:12:22: error: ‘scanf’ was not declared in this scope
scanf("%s", file_name);
^
prog.cpp:13:20: error: ‘flush_input_buffer’ was not declared in this scope
flush_input_buffer();
^
prog.cpp:15:38: error: ‘fopen’ was not declared in this scope
if (outputFile = fopen(file_name, "w") == NULL) {
^
prog.cpp:15:43: error: ‘NULL’ was not declared in this scope
if (outputFile = fopen(file_name, "w") == NULL) {
^
prog.cpp:17:8: error: ‘EXIT_FAILURE’ was not declared in this scope
return EXIT_FAILURE;
^
prog.cpp:22:19: error: ‘stdin’ was not declared in this scope
while ((ch = getc(stdin)) != EOF) ; {
^
prog.cpp:22:24: error: ‘getc’ was not declared in this scope
while ((ch = getc(stdin)) != EOF) ; {
^
prog.cpp:22:30: error: ‘EOF’ was not declared in this scope
while ((ch = getc(stdin)) != EOF) ; {
^
prog.cpp:23:20: error: ‘putc’ was not declared in this scope
putc(ch, outputFile);
^
prog.cpp:26:18: error: ‘fclose’ was not declared in this scope
fclose(outputFile);
^
prog.cpp:31:8: error: ‘EXIT_SUCCESS’ was not declared in this scope
return EXIT_SUCCESS;
^
prog.cpp: In function ‘void flush_input_buffer()’:
prog.cpp:35:16: error: ‘getchar’ was not declared in this scope
while (getchar() != '\n') {
^