For future posts:
1) please don't paraphrase the error. Especially if you don't understand it. It's better to post the full error.
2) Please tell us what line the error occurs on. It is given to you in the error message. And in most IDE's you can just double-click on the error message and it will jump you to the line.
That said... the error is here:
'temp[i]' is a single character (
char
). 'suit' is an array of 30 characters (
char[30]
). You cannot assign a single character to an entire array of characters. That is nonsense.
You probably meant to do this:
|
deck[i].suit[i] = temp[i];
|
But even that is wrong because you're using the same index (
i
) for both 'deck' and 'suit'.
Let me ask you this.... why do you need tempRank and temp? Why can't you just read into your deck directly? It would certainly simplify things.