I'm looking for instructions about documenting exit codes in my C file.
As example, I have the following:
if( !(new_std = (student*) malloc(sizeof(student))) )
exit(1);
//+1 is for the \0, strlen does not give us that one!
if( !(new_std->name=(char*) malloc(1+sizeof(char)*strlen(name)))){
free(new_std);
exit(1);
}
What is the proper way to document in my file, that exit with number 1, means memory allocation failure?