I have been working on this program to count the number of zero's odd, and even numbers that a user inputs. I have tried different variations and cannot get it to go, I keep getting linker errors and cannot see where the problem is. I am new to this and could really use the help.
#include "stdafx.h"
#include <iostream>
#include <iomanip>
void ClassifyNum(long remainder, long& countZero, long& countOdd, long& countEven );
void GetNum(long& num);
void Start(long remainder,long& countZero, long& countOdd, long& countEven);
using namespace std;
int main( )
{
long number;
int numCounter;
int userInput;
long zero;
long odd;
long even;
long remainder;
char userAnswer;
do{
Start(remainder,zero, odd, even);
cout << "Please enter an number. " << endl;
cin >> userInput;
for (numCounter = 1; numCounter <= userInput;numCounter++)
{
GetNum(number);
cout << number << " ";
ClassifyNum(remainder, zero, odd, even);
}
cout << endl;
cout << "Go again? (y/n). ";
cin >> userAnswer;
cout << endl;
}while(userAnswer=='y');
return 0;
}
void start(long remainder,long& countZero, long& countOdd, long& countEven)
{
remainder = 0;
countZero = 0;
countEven = 0;
countOdd = 0;
}
void GetNum(long& num)
{
cin >> num;
}
void ClassifyNum(long remainder, long& countZero, long& countOdd, long& countEven)
{ if (remainder == 0)
countZero++;
else if (remainder%2 == 0)
countEven++;
else
countOdd++;
}