1
0

forc99.c 534 B

123456789101112131415161718192021
  1. // forc99.c -- new C99 block rules
  2. #include <stdio.h>
  3. int main()
  4. {
  5. int n = 8;
  6. printf(" Initially, n = %d at %p\n", n, &n);
  7. for (int n = 1; n < 3; n++)
  8. printf(" loop 1: n = %d at %p\n", n, &n);
  9. printf("After loop 1, n = %d at %p\n", n, &n);
  10. for (int n = 1; n < 3; n++)
  11. {
  12. printf(" loop 2 index n = %d at %p\n", n, &n);
  13. int n = 6;
  14. printf(" loop 2: n = %d at %p\n", n, &n);
  15. n++;
  16. }
  17. printf("After loop 2, n = %d at %p\n", n, &n);
  18. return 0;
  19. }