|
From: <and...@su...> - 2003-05-22 17:39:22
|
Dear Users,
1. Every time I finish a code without problems the final code is return 0
for an int main()
function;
2. But, if exists inside the code a primary condition for the code run I use
a piece of
code like the following:
...
char *ptr;
ptr=malloc(10*sizeof(char));
if(!ptr)
{
printf("no mem");
exit(1);
}
...
That is, I scape in advance of the execution because lack of resources;
3. It´s my interest to change the zero of the 1 statement for an
EXIT_SUCCESS stdlib.h constant;
4. I couldn´t find an constant for 1 in an EXIT style;
5. I think I can´t change an exit(1) for an exit(EXIT_FAILURE) because this
constant is equal to
-1;
My Questions:
A) Can I make the #3 substitution?
B) Is that true the #4 statement?
C) Can I make the #5 substitution?
Regards
Andre
|