In small programs like the above which is the best way to exit after an error ?Code:#include <stdio.h> #include <stdlib.h> int main(void) { float light[3][3]; FILE *Input; Input = fopen("bunny2.mtl","rb"); if(Input==NULL) { fprintf(stderr,"Cannot find bunny2.mtl file.\n"); exit(-1); //Exit return -1; //Exit } fclose(Input); return 0; }
return or exit() or it doesn't matter which one to choose ?