Code:
char fileName[100];
int a;
do{
printf("Enter the full file path that you would like to save the file to \n");
printf("e.g. C:\\Temp\\Employee.csv\n");
printf("NOTE THE .CSV EXTENSION\n\n");
gets(fileName);
a = (stricmp(strpbrk(fileName, ".csv" ), ".csv"));
printf("%d", a);
if(strcmp(strpbrk(fileName, ".csv" ), ".csv") < 0)
printf("Invalid file extension\n\n");
}while((stricmp(strpbrk(fileName, ".csv" ), ".csv") < 0));
hi, i got a problem here, my a prints 53 no matter what extensions i type instead of a negative number.. can anyone tell me how to overcome it??
When i enter a.csv it gives me the 0, however i need to allow user to specify the drives when i enter c:\a.txt it gives me 53, when i enter c:\a.csv it also prints 53