I am not sure about the first question, but if you use sizeof(main()),
it gives the ans 4.
vishal@ubuntu:~/progs/c\ 09:12:57 PM $ cat alg.c
#includestdio.h
int main()
{
printf(%d\n,sizeof(main()));
return 0;
}
vishal@ubuntu:~/progs/c\ 09:13:00 PM $ gcc alg.c
vishal@ubuntu:~/progs/c\
No. it's wrong.
sizeof(main()) == sizeof(int) because main return integer.
i
- Mail original -
De : Vishal Thanki vishaltha...@gmail.com
À : algogeeks@googlegroups.com
Cc :
Envoyé le : Mercredi 27 Juillet 2011 15h45
Objet : Re: [algogeeks] sizeof() question.
I am not sure about
- Mail original -
De : Vishal Thanki vishaltha...@gmail.com
À : algogeeks@googlegroups.com
Cc :
Envoyé le : Mercredi 27 Juillet 2011 15h45
Objet : Re: [algogeeks] sizeof() question.
I am not sure about the first question, but if you use sizeof(main()),
it gives the ans 4.
vishal@ubuntu