OK when you have a function it has to be a type int,float,char,or void or some other value. void does not return a value. You can think of it like this.
Code:
#include <iostream>
int add(int a,int b);
float divide(int a,int b);
void printStuff(int a,int b);
int main(void)
{
int addResults = add(10,5);//This is setting the variable addResults to the return of the function add()
float divideResults = divide(9,4);//doing the same as the first but with divide
std::cout<<addResults<<std::endl;
std::cout<<divideResults<<std::endl;
printStuff(10,10);//this will do whats in the funtion
std::cin.get();
return 0;
}
int add(int a,int b)
{
return (a+b);
}
float divide(int a,int b)
{
return (a/b);
}
void printStuff(int a,int b)
{
std::cout<<"a equals: "<<a<<std::endl;
std::cout<<"b equald: "<<b<<std::endl;
//notice it doesn't return a value!
}