Here is my program with the errors any help would be appreciated.
error C3861: 'headTail': identifier not found, even with argument-dependent lookup
error C3861: 'results': identifier not found, even with argument-dependent lookup
error C2365: 'headTail' : redefinition; previous definition was a 'formerly unknown identifier'
error C2365: 'results' : redefinition; previous definition was a 'formerly unknown identifier'
Program:
#include <iostream>
using namespace std;
int getRandom();
voidHeadTails(int &random, int &count);
voidResults(int &count);
int main ()
{
cout << " Name" << endl << endl;
srand(time(0));
int random;
int count = 0;
for (int count2 = 1; count2 <= 100; count2++)
{
random = getRandom();
headTail(random,count);
}
results(count);
cout << "\n\n";
return 0;
}
int getRandom()
{
int random;
random = rand() % 2;
return random;
}
void headTail(int &random, int &count)
{
if (random == 0)
{
cout << "Heads" << endl;
}
else
{
cout << "Tails" << endl;
count ++;
}
}
void results(int &count)
{
int tails;
tails = (100 - count);
cout << "The coin landed on HEADS " << count << " times.\n";
cout << "The coin landed on TAILS " << tails << " times.\n";
}