What will be the output of the following program?
- 320
- 3
- 64
- Compilation error
- None Of These
Correct answer 64
Explanation:
we know int is a 4-byte data byte while char is a 1-byte data byte. char pointer can keep the address one byte at a time.
The binary value of 320 is
00000000 00000000 00000001 01000000 (In 64 bit)
So ptr is pointing only the first 8 bit and the Decimal value is 64.
0 comments:
Post a Comment