Consider the following program
{ int x=1; printf("%d",(*char(char*)&x)); }
Assuming required header files are included and if the machine in which this program is executed is little endian, then the output will be
https://www.geeksforgeeks.org/little-and-big-endian-mystery/
useful to understand Big endian and little endian.
main() { int x=1; printf("%d",(*char(char*)&x)); }
Here,we will get a compilation error because 'char' is extra.
If the code is :
main() { int x=1; printf("%d",(*(char*)&x)); }
OUTPUT: 1 option(c)
64.3k questions
77.9k answers
244k comments
80.0k users