/*
Name: Sean Griffin
Date: October 12, 2006
Description: Write code that will simulate the addition of numbers
using pointers.
This code will create two functions. One function will
will request a number from the user. The other function
will add numbers passed to it and return the result.
*/
#include <iostream>
int add(int *, int *);
void req_num(int *);
void main(void)
{
int a, b;
req_num(&a);
req_num(&b);
add(&a, &b);
char c1;
std::cin >> c1;
}
int add(int *a, int *b)
{
return (*a+*b);
}
void req_num(int *num)
{
std::cout << "Please insert your value: " << std::endl;
std::cin >> *num;
}
/*
Sample Output
*/