today i made FILE I/O but i wanted the user to press his like if he want name lol.txt it will make it as lol.txt i made it work but it only accept 10 char array when i change the fgets to lets say 100 it doesnt want to :S i dunno whats with this error
Code:
#include "inc.h"
int main(void)
{
char name[100];
FILE*fptr;
printf("Where do u wanna save your file ??");
fputs("PLease enter your file name: ",stdout);
fgets(name,10,stdin);
fptr=fopen(name,"w");
if(fptr==NULL)
{
fprintf(stderr,"Coudlnt Access %s - because %s",name,sys_errlist[errno]);
exit(1);
}
fprintf(fptr," ");
getchar();
fclose(fptr);
return 0;
}