B
Bilgehan.Balban
Hi,
Generally in my C code, I use the following convention to return
success or failure:
a) For functions that return a pointer, (allocation, filling-in a
structure etc.) return Null for all errors, and the appropriate pointer
for success.
b) For functions that checks for a condition such as is_working() etc.
obviously 0 for false and 1 for true.
c) For any other functions return 1 for error, 0 for success.
Do you think this is a good approach, or can you suggest any better
approach?
Thanks,
Bahadir
Generally in my C code, I use the following convention to return
success or failure:
a) For functions that return a pointer, (allocation, filling-in a
structure etc.) return Null for all errors, and the appropriate pointer
for success.
b) For functions that checks for a condition such as is_working() etc.
obviously 0 for false and 1 for true.
c) For any other functions return 1 for error, 0 for success.
Do you think this is a good approach, or can you suggest any better
approach?
Thanks,
Bahadir