This is a discussion on Simple poker code within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by got1sleeve My teacher must have confused me then. I originally had the & in there and he ...
well I struggle with c++ let alone know anything about c haha i stick to this forum....but any suggestions as to why the code doesn't output anything?
Let's fire up the debugger!
Duh! Of course!
You're reading a string or a char into an int. Ansr must be a char.Code:int ansr; cout << "\n\nTo deal yourself a poker hand please press D. " ; cin >> ansr;
You can also remove n from the function because you aren't using it.
Also, in get card:
Apparently, you get an implicit conversion from int to char here, so you might as well do an explicit conversion by doing a cast and silencing a warning.Code:default: val=value;