Here is a class for my first real project (nothing too complicated.)
1 2 3 4 5 6 7 8 9
class player
{
public:
string sName;
int nDiff;
void Giveinfo();
void Getinfo();
int Getdiff();
}
I'm not getting the debug error there, but
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
int player::Getdiff()
{
int d;
bool iscorrect;
for (iscorrect != true) {
cout << "Please type 1, 2, or 3 for the level \n of difficulty you would like" << endl;
cin >> d;
iscorrect=true;
if (d>3) {
cout << "That's more than 3, lets try this again..." << endl;
iscorrect=false;
}
elseif (d<1) {
cout << "That's less than 1, lets try this again..." << endl;
iscorrect=false;
}
}
return = d;
}
on the first line of that function. It's telling me that
23 C:\Dev-Cpp\My .devs\blackjack.cpp new types may not be defined in a return type
and
23 C:\Dev-Cpp\My .devs\blackjack.cpp prototype for `player player::Getdiff()' does not match any in class `player'
but I see nothing wrong with my function definition.
And of course, I have
1 2 3 4 5 6 7
#include <cstdlib>
#include <iostream>
#include <strings.h>
usingnamespace std;
using std::string;
using std::endl;
at the top.
So, if you see anything wrong with the function or need the full code, let me know :D Thanks!