I want to make a file that is in a map....
I open it this way.
Now that works great as long as that map exists. I deleted the map and tried to run it and perror gave me an error. Is there a way that i can know wich error has been given. That way i would be able to see wether its a problem with the non-existent map or something else.Code:FILE *myfile; myfile=fopen(map,"w"); if(myfile==0){ perror("\n"); printf("Press a key to continue.\n"); getch(); exit(1); }
And then i would make the program create the map and then do the fopen thing again.
I know the error thing has something to do with errno ..its just how do i use errno. (my lib reference wasnt that clear IMO).
::edit::
whoops forgot to place code tags
BTW : map is data\\whatever_file_user_wants_to_open.whatever_ex tension_i_add



LinkBack URL
About LinkBacks




.