Hi again!And happy new year to all.Just got to attained an interview and was asked about some c questions.Would like to know what does these lines means?Can anyone tell me?
int main()
{
int k=printf("Hello");
return 0;
exit(10);
}
I got answeres like
You're outputting "Hello" on the screen but since the function main has to return an integer (you said that when you named the function "int main()") you return 0 (meaning that the function has succeed)
But if the function doesn't work, the exit function will end it up and return a code error 10
But at interview I was asked questions like, what is the relation between int k and return 0?why it is returning 0?where it is passing it?who is checking if the function has succeded or not?and so on.Please guide me.As i cant find the explaination over internet.