What will be the output of program
#include <stdio.h>
int fun(char *a){
printf("%d\n",sizeof(a));
return 1;
}
int main(){
char a[20];
printf("%d\n",sizeof (fun(a)));
return 0;
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Except with variable length arrays,
sizeofdoes not evaluate its operand. So it will just yield the size offun(a)type, i.e.sizeof(int)(without calling the function).