lesson 13 lclname cpp
[[lesson_13_lclname_cpp]] last edit on Aug 18, 2005 7:10 AM by rescued_by_c

[user02@FC4 Lesson13]$ cat -n lclname.cpp
   1  #include <iostream>
   2  using namespace std;
   3
   4  int add_values(int a, int b)

   5  {
   6     int value;
   7
   8     value = a + b;
   9
  10     return(value);
  11  }
  12
  13  int main()
  14  {
  15     int value = 1001;
  16     int other_value = 2002;
  17
  18     cout << value << " + " << other_value << " = " << add_values(value, other_value) << endl;
  19
  20     return 0;
  21  }
[user02@FC4 Lesson13]$ g++ -o lclname lclname.cpp
[user02@FC4 Lesson13]$ ./lclname
1001 + 2002 = 3003
[user02@FC4 Lesson13]$