Strcpy to and from arrays question from bonehead newb
Im writing a card game. below is the code for the actual deck building witch is based on a previous function which randomizes 52 cards 1- 52.
For the sake of brevity I have only included the specific code.
The problem specifically is the last line which spits out "unterminated macro-like function invocation"
Code:
#include <stdio.h>#include <strings.h>
#define numcardsuit 13
#define deckcards 52
int main (int argc, const char * argv[])
{
char value[numcardsuit+1][3]={"2","3","4","5","6","7","8","9","10","J","Q","K","A"};
char playdeck[deckcards+1][3];
char shuffledDeck[52];
for (int counter=0; counter < deckcards; counter++) {
if (shuffledDeck[counter] <= numcardsuit) {
strcpy(playdeck[counter],"D");
strcpy(playdeck[counter][counter],value[shuffledDeck[counter]][0];
I have racked my head for the last 2 nights trying to find a solution before posting but man.. I thought assembly was tuff :rolleyes:
by the way, Ill accept any and all advise you can give out. I have a book on C in mail but for right now, its c for dummies and it gives arrays and pointers a single page between them
Thanks for your help in advance
Micheal