From d22453ea718ebba5820ca78603dee3bac8623d0f Mon Sep 17 00:00:00 2001 From: zeekling Date: Sat, 16 Oct 2021 19:11:48 +0800 Subject: [PATCH] add chapter3/altnames.c --- chapter3/altnames.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 chapter3/altnames.c diff --git a/chapter3/altnames.c b/chapter3/altnames.c new file mode 100644 index 0000000..374fe3f --- /dev/null +++ b/chapter3/altnames.c @@ -0,0 +1,14 @@ +#include +#include + +int main(int argc, char const *argv[]) +{ + int32_t me32; + me32 = 45933945; + printf("First, assume int32_t is int:"); + printf("me32 = %d\n", me32); + printf("Next, let't not mak any assumption.\n"); + printf("Instead, use a \"macro\" from inttype.h:"); + printf("me32 = %" PRId32 "\n", me32); + return 0; +}