writing part of a program where user inputs an ID and the program generates a .txt file with the ID name(numerical ID).
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#define INFILE "config.txt"
#define OUTFILE "studentans.ans"
#define IDFILE "stdin"
int main(int argc, char *argv[]) {
FILE *fout;
fout = fopen(IDFILE, "w");
printf("Enter Student ID number:");
while(1) {
getc(stdin); // id is entered
fputs(stdin, fout); //generates the text file
}
return 0;
}
but i keep getting these errors:
14:14 C:\Dev-Cpp\assignment 4.c [Warning] multi-character character constant
14 C:\Dev-Cpp\assignment 4.c [Warning] passing arg 1 of `fopen' makes pointer from integer without a cast
20 C:\Dev-Cpp\assignment 4.c [Warning] passing arg 1 of `fputs' makes pointer from integer without a cast
using dev-cpp but programming in C
any ideas?