Solution for Exercise 19-17
ex1917
#include <stdio.h> int main() { char *fruit[] = { "watermelon", "banana", "pear", "apple", "coconut", "grape", "blueberry" }; int x; for(x=0;x<7;x++) puts(fruit[x]); return(0); }
Notes
* This example isn't really a pointer example at all. It merely shows another way to create an initialized array of strings. Array notation is still used throughout.
Copyright © 1997-2024 by QPBC.
All rights reserved