lesson 11 nochange c
[[lesson_11_nochange_c]] last edit on Aug 18, 2005 6:53 AM by rescued_by_c

[user02@FC4 Lesson11]$ cat -n nochange.c
   1  #include <stdio.h>
   2
   3  void display_values(int a, int b)
   4  {
   5     a = 1001;

   6     b = 1001;
   7
   8     printf("The values within display_values are %d and %d\n", a, b);
   9  }
  10
  11  int main(void)
  12  {
  13     int big = 2002, small = 0;
  14
  15     printf("Values before function %d and %d\n", big, small);
  16
  17     display_values(big, small);
  18
  19     printf("Values after function %d and %d\n", big, small);
  20
  21     return 0;
  22  }
[user02@FC4 Lesson11]$ gcc -o nochange nochange.c
[user02@FC4 Lesson11]$ ./nochange
Values before function 2002 and 0
The values within display_values are 1001 and 1001
Values after function 2002 and 0
[user02@FC4 Lesson11]$