in view of this and this, here is my strategy(similar to win32 api functions) :
1)Reserve return value for indicating success(non zero value),error(0).
2)use errno,perror to give more info. on the type of error.
3)use parameters to return values.
If this is OK then can I define my own error codes(not conflicting with the existing codes) and use errno to set/retrieve them. I don't think now I would be able to use perror with these codes(it will always say:unknown error) but I can define my own switch case based function to return description of the error code.I could define my own variable but much has already been done to make errno modern and thread safe.
eg:
int val;
if(MyPop(&val))
pintf_s("\n %d popped from my stack. . .",val);
else
printf_s(Myperror());
Thanks.