#### Let's call this one labscan.c #### Write a program that reads pairs of numbers and prints them out. #### Make the changes shown in the following diff and recompile 5c5 < for (int i=0; i for (int i=0; i<100; ++i) { #### Run it... This will not go well #### Type the command "env" to see where these values came from $$$$ env #### Modify your program to print the pointer not its value. Here's a diff 6c6 < printf("arg %3d is %s\n", i, argv[i]) ; --- > printf("arg %3d is %d\n", i, argv[i]) ; #### You get a "pedantic" error. Go ahead and run it! #### Let's get rid of the 100. Go back to argc. #### Take a *long* look at the man page for fprintf. The reference to a pointer! #### Change the format to print argv[i] as a pointer. (Use %p.) #### Ugh -- hex... Try %d. #### Ugh -- Try to cast argv[i] to (int) #### Ugh -- Try to cast argv[i] to (void *) -- that is the "generic" pointer #### Ugh -- Try to cast argv[i] to (void *) to (int), that is (int)(void *) #### Ugh -- Different sizes... Change the (int) to (long) #### Ugh -- Change format specifier to %ld #### Wait... I liked the HEX better than that. Go to %lx. #### But it's 64 bits... that's 4*16. Try %16lx . #### ALL CAPS would look better. Try %16lX #### Let's have some leading zero's. That's %016lX #### Let's add the string back in. The output should be something like: arg 0 is at 00007FFCD9248D59 and is ./funlab arg 1 is at 00007FFCD9248D62 and is do arg 2 is at 00007FFCD9248D65 and is me arg 3 is at 00007FFCD9248D68 and is ri