0 votes 0 votes #define int char main(){ int i=66; printf("%d",sizeof(i)); } Programming in C programming programming-in-c + – sdpshaw asked Oct 2, 2015 sdpshaw 640 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 0 votes 0 votes Answer --> 1 . Printf ( "%d", sizeof ( i ) ) --> As , size of returns the type of i is int / char than Printf() returns the number of characters successfully printed on the screen . Example refer --> http://geeksquiz.com/c-language-2/input-and-output/ Vinay Yadav answered Oct 2, 2015 selected Apr 13, 2018 by rio Vinay Yadav comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes output will be 1.(size of i ) since pre processor is used as #define int char which change the int to char . in most of the system char size is 1 byte that is why. Umang Raman answered Oct 2, 2015 Umang Raman comment Share Follow See all 3 Comments See all 3 3 Comments reply Arjun commented Oct 2, 2015 reply Follow Share sizeof char is fixed in C and is system independent. It is always 1. But we can use extended char in C. 0 votes 0 votes Umang Raman commented Oct 2, 2015 reply Follow Share and what about int and float? 0 votes 0 votes Arjun commented Oct 2, 2015 reply Follow Share Just checked the standard. Everything is implementation defined- I was wrong- Page 505 here. http://port70.net/~nsz/c/c11/n1570.pdf 0 votes 0 votes Please log in or register to add a comment.