Question: Consider the following code: int i = 0x56789a; char c = (char) i; int j = c; What is the hex value of c? (0x9a)

Consider the following code:

int i = 0x56789a;

char c = (char) i;

int j = c;

What is the hex value of c? (0x9a)

What is the hex value of j? (0xffffff9a)

I know the answer but I don't know how to get to that answer.

Can someone explain this to me, please? Thanks!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!