The program reads the contents of the files specified as command line arguments. If the current argument causes an error (the file could not be opened), write an error message to the standard error output and continue execution with the following argument. The error message should be: File opening unsuccessful !.
#include <stdio.h>
int main() {
char name[1024];
scanf("%s",name);
FILE* fp = fopen("name.txt", "r");
if (fp !=0 ){
printf("Open is successfull");
} else {
printf("File opening unsuccessful! \n");
}
fclose(fp);
}