First off, what problems are you having. It really helps if you tell it whats it doing and what it's supposed to be doing.
At first glance (I don't have a lot of time right now), I see:
You should probably put line 37 before you enter the loop. Don't know if that matters too much.
Line 110 - should be either
else if(blah blah blah){}
or just
else{}
Also you can't do what your are doing there. (and also it doesn't make much sense) You have to say something like
|
else if(wantCard == 'N' || wantCard == 'n'){}
|
Line 120-123 - That doesn't make much sense at all to me. If you want a random number between 1 and 10, you say
|
randomnumber = rand() % upperLimit + lowerlimit
|
You got that part all jumbled up even though it's doing the same thing.
You have a random curly bracket on line 101, I think it's supposed to be for the while loop though.
You have variables all over the place that have limited scope. For instance, for you hit function, you do display the correct amount that should be. But cardTotal is destroyed at the end of that function and
person
is unchanged. You should do something like
1 2 3 4 5 6 7 8
|
int Hit(int person)
{
//make random number
person += Random(1, 10);
return person;
}
person = Hit(person);
|
or something...
Or instead of that just get rid of cardTotal altogether and use playerScore since you are passing it by reference for some reason..
That's all for now. I think you should work on it a bit, try to isolate any problems you are having and then repost your code.