Solution for Exercise 18-2
ex1802
#include <stdio.h>
int main()
{
char string[] = "Does this string make me look fat?";
printf("The string \"%s\" has a size of %u.\n",
string,sizeof(string));
return(0);
}
Notes
* As with Exercise 18-1, if you're using a Macintosh, or some other Unix variant, change the %u conversion character used in printf() at Line 7 to %ld. On those systems, the sizeof operator returns a long int value.
Copyright © 1997-2025 by QPBC.
All rights reserved
