Solution for Exercise 19-15
ex1915
#include <stdio.h> int main() { char *sample = "From whence cometh my help?\n"; while(putchar(*sample++)) ; return(0); }
Notes
* As the code manipulates the sample
pointer in Line 7, its value changes. Effectively, the original location stored in sample
is lost. So if I wanted to re-display or manipulate the string later in the code, I would be unable to use sample
again. (Well, I could, but it would require way too much math and guessing and more overhead that could simply be avoided by not declaring the string by using a pointer.)
Copyright © 1997-2024 by QPBC.
All rights reserved