how are you?
int stack_empty(stack *s){
return (s == NULL); /* I dont get this part, it returns what if its null? */
}
int main(){
stack *s;
if(stack_empty(s)){ /* what it means? like... whats the standard return of a function? */
printf("its empty");
}
return 0;
}
My questions are in the comments of the code. Briefly they are:
-> Whats the standard return of a function?
-> What does return something == NULL means?
*I know what NULL, s or == means… my questions lies on those abreviated expressions.
==is a test for equality.If s is null then
s == nullis true the expression has a non zero value, sostack_emptywill return non zero (probably 1). If s is not null, thens == nullis false so the method will return 0.The if statement is effectively saying
if expression is not 0.