I just want to prompt some integer from the user and pass it to the constructor function
Here's my class:
class queen {
int N;
int** queens;
int *BFSq;
int s;
int front = 0;
int rear = -1;
int *found;
And here's my constructor:
public:
queen(){};
queen(int n)
{
N=n;
queens = new int*[n];
for(int i = 0; i < n; ++i)
queens[i] = new int[n];
for (int i=0; i<n; i++) {
for (int j=0; j<n; j++) {
queens[i][j]=0;
}
}
BFSq = new int[n];
found = new int[n];
}
And here is my main()
function:
int main(){
int ent = 0;
cout<<"Please enter the size of your board\n";
cin>>ent;
queen(ent);
}
I just want to pass ent
value as int n
argument to my constructor,but i think I'm not doing it right because I'm getting errors
EDIT: the error is "redefinition of 'ent' with a different type:'queen' vs 'int' "