I\'m writing a program to write card values into a 52 spot character multi-dimensional array. This program is one test array that I will write as a function into the main progra
You need to doing a strcpy and not assigning string literals directly. Also, the array usage is wrong.
The code should be like below:
#include
#include
int main ()
{
char CardValue[52][6];
int i;
/* Not clear what you are trying in the below 2 lines. But, it'll not work :-) */
/*CardValue[i][6]=i;
CardValue[i];*/
for (i=0;i<52;i++)
{
switch (i%13)
{
case '0': strcpy(CardValue[i],"ACE");
break;
case '1': strcpy(CardValue[i],"2");
break;
/** Do the same way for other case **/
}
}
}