Solution for Exercise 18-11
ex1811
#include <stdio.h> int main() { char a,b,c; char *p; a = 'A'; b = 'B'; c = 'C'; printf("Know your "); p = &a; // Initialize putchar(*p); // Use p = &b; // Initialize putchar(*p); // Use p = &c; // Initialize putchar(*p); // Use printf("s\n"); return(0); }
Notes
* Line 8 isn't a trick. I'm just taking advantage of the fact that the compiler ignores white space. So rather than separate each statement with an Enter key press, I used a space.
Copyright © 1997-2024 by QPBC.
All rights reserved