2.57 More show Procedures
★
Problem:
Write procedures show_short
, show_long
, and show_double
that print the byte representations of C objects of types short
, long
, and double
, respectively. Try these out on several machines.
void show_short(short x) {
show_bytes((byte_pointer) &x, sizeof(short));
}
void show_long(long x) {
show_bytes((byte_pointer) &x, sizeof(long));
}
void show_pointer(double x) {
show_bytes((byte_pointer) &x, sizeof(double));
}
Last updated
Was this helpful?