-
Notifications
You must be signed in to change notification settings - Fork 0
/
func.cpp
35 lines (32 loc) · 879 Bytes
/
func.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* =====================================================================================
*
* Filename: func.cpp
*
* Description: Demonstration of using functions with arguments.
*
* Version: 1.0
* Created: 27/12/12 22:20:02
* Revision: none
* Compiler: gcc
*
* Author: Robert Halliday (rh), [email protected]
* Company: rphhpr
*
* =====================================================================================
*/
#include <iostream>
int Add (int x, int y)
{
std::cout << "In Add(), recieved " << x << " and " << y << "\n";
return (x+y);
}
int main()
{
std::cout << "I'm in main()!\n";
std::cout << "\nCalling Add()\n";
std::cout << "The value returned is: " << Add(3,4);
std::cout << "\nBack in main().\n";
std::cout << "\nExiting...\n\n";
return 0;
}