>My int Main is basically all messed up because based on the examples in my text book it
>appears that I should have my cout statements in main, but they are also in the function on some examples.
Your main is basically messed up because it's a declaration and not a definition. ;) You need to have a body for any function you intend to run. Something like this:
#include <cstdlib>
#include <ctime>
#include <iostream>
void flip();
int main()
{
std::srand ( static_cast<unsigned> ( std::time ( 0 ) ) );
flip();
}
void flip()
{
// Your coin flipping logic
} Note that srand needs to be called only one time, or very very infrequently. With modern random number generators, a single seed goes a long way.
As for your coin flipping logic, it looks largely decent. The syntax for your conditional is wrong because you need to surround the condition in parens:
flip = rand() % 2;
if ( flip == 1 )
headsCounter++;
else
tailsCounter++; Finally, you should be placing this in a loop. Right now you're only testing one coin toss, so I'd recommend an argument to the function that specifies how many tosses you want, and a counting loop that contains the tossing code.