#include <stdafx.h> #include <stdio.h> #include <stdlib.h> #define CHAPTER0 "Introduction" #define CHAPTER1 "Getting started with C" #define CHAPTER2 "Introduction to Data Types" #define CHAPTER3 "Working with Numbers" #define CHAPTER4 "Control Structures" int main (void) { char chapters[5][27] = {CHAPTER0, CHAPTER1, CHAPTER2, CHAPTER3, CHAPTER4}; char *chapters_ptr[5] = {CHAPTER0, CHAPTER1, CHAPTER2, CHAPTER3, CHAPTER4}; printf ("The chapters array uses %zu bytes of memory.\n", sizeof(chapters)); printf ("The chapters_ptr array uses %zu bytes of memory.\n", sizeof(chapters_ptr)); getchar(); return 0; }
%zu
printf()
printf ("The chapters array uses %u bytes of memory.\n", sizeof(chapters));
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)