![]() |
Pointer to point to 3rd byte of an integer
One of the tricky question in interview comes out is
How do you point to the third byte of an integer. Assumption that integer is 4 byte. Here is the code to do the same Code: CPP
|
Re: Pointer to point to 3rd byte of an integer
union {
int i; char c[4]; } vars; vars.c[2] is the third byte of vars.i. |
Re: Pointer to point to 3rd byte of an integer
Quote:
|
Re: Pointer to point to 3rd byte of an integer
good way
|
| All times are GMT +5.5. The time now is 02:11. |