L#include typedef unsigned char *byte_pointer; void show_bytes (byte_pointer sta
ID: 3755292 • Letter: L
Question
L#include typedef unsigned char *byte_pointer; void show_bytes (byte_pointer start, int len) int for 1, (i-e;1len;i++) printf(" %. 2x", start [i]); printf("In"); void show int(int x) show-bytes((byte-pointer) &x, sizeof(int)); void show float(float x) show-bytes( (byte-pointer) &x, sizeof(float )) ; void show_double(double x) show bytes( (byte-pointer) &x, sizeof(double)); void show_pointer (void *x) show bytes( (byte-pointer) &x, sizeof(void *)); int main() int I-2147483645 int ival--54321; float fval-(float) ival; double dval-(double)ival; int *pval-&ival,; char *s-"ABCDEF"; show int(ival): show_float(fval); show_double(dval); 7show_pointer (pval); show bytes (s,strlen (s)); I-I+10; printf("2147483645+10= %d",1);Explanation / Answer
1. Hexadecimal binary representation with Big Endian
2. ival binary representation will be 1100111100101011
3. pval will be the byte addressing of an unsigned integer variable.
4. s will have the start address of the given string
5. sign exp frac
0 +30 1. 9999999972060323
6. sign exp frac
0 +6 1.125
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.