26.04.2013, 11:26
Well.. lets make it step by step:
When it fails to open, i'm closing file handler to open it again for writing binary, because earlier I used it for read binary, to let me check if its created or not.
But maybe, there's more efficient way, if so, could you tell me please? Because I noticed that C uses standard file handling, but I stopped using it a while ago (I'm more familar with y_ini, which is a little bit different, but lets don't complain PAWN with C)
Tutor told me to use integer to return 0 always, because It's gonna mean:
And in other point, I can use return 1 if I need. That's what he said.
Quote:
|
just one thing, why is that
pawn Код:
|
pawn Код:
// Open each file for reading binary.
team_file = fopen(file_path, "rb");
// If file exists in the given location.
if(team_file)
{
count += 1;
printf("\nFile is already created there!\nPress any key to continue. . .");
getch();
}
else
{
// Close file from reading.
fclose(team_file);
Quote:
|
also, this is not a bug but, why the function return type is integer ? the func always returns 0 so u could just use "void" as a type and remove the return, but as i said its not a big deal, just to point it out
|
Quote:
|
Originally Posted by Tutor
0 run time errors
|

