I\'m having issues with the error check if else statement When I enter ^z for fi
ID: 3764205 • Letter: I
Question
I'm having issues with the error check if else statement
When I enter ^z for file name, it is suppose to enter the if stat and print the the error message, but it skips the if else statement entirely and continues on to my next function. I think that my parameter for the if statement is wrong, I'm not really sure though. Also, in main this is how i defined rc: int rc;
void getFile(char file_name[], int* rc)
{
printf(" Project 4: ");
printf(" Enter File Name: ");
*rc = scanf("%s", file_name);
if(*rc == 0)
{
printf(" Error: No file name entered.");
exit(100);
}
return;
}
Explanation / Answer
your are strating with ponter = Null
{
then you can start your else part.
*rc=scanf("%s",filename) is incompatible implicit declaration of built-in function 'scanf'.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.