I have 2 error for my code when i compile and i need some guidance =)
This is a small part of my program.
Here's my code.
I declare my function like below:
void working (Stack& deck, Stack& deckStack, List* column, Stack* stack, bool& loadGame, bool& exitGame, bool& newGame, char user[40], int& num, int& from, int& to, bool& next)
{
int k =13,j;
string file, x;
char a;
char userInput[2];
It shows error: invalid initialization of reference of type 'Stack&' from expression of type 'std::string'
x = strstr (user, " ");
file = x.erase(0,1);
save(file, deck, deckStack, column, stack); // error here
newGame = true;
break;
second error are as below:
error: expected primary-expression before '{' token
error: expected `;' before '{' token
userInput = {user[5], user[6]}; //error here
num = atoi(userInput);
userInput = {user[24], user[25]}; //error here
from = atoi(userInput); from--;
userInput = {user[36],user[37]}; //error here
to = atoi(userInput);
to--;
move (3, num, from, to, deckStack, column, stack);
Kindly if anyone know my problem please guide me. Thanks =)