求告知为什么出现warning
//发纸牌 花色有梅花,方块,红桃和黑桃,点数有2.3.4.5.6.7.8.9.10.J.Q.K.A。要求根据用户输入的牌数n,随机发n张纸牌。#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<string.h>
#include<malloc.h>
char *str1[4] = {"梅花","黑桃","红桃","方块"};
char *str2[13] = {"2","3","4","5","6","7","8","9","10","J","Q","K","A"};
char *card[13];
void sendcards(int n);
void printcards(int n);
int main(){
int n;
printf("请输入发牌张数:");
scanf("%d",&n);
sendcards(n);
printcards(n);
return 0;
}
void sendcards(int n){
int sign [4][13] = {0};
int k, i, j;
srand(time(NULL));
for (k = 0; k < n; ){
i = rand() % 4;
j = rand() % 13;
if (sign[i][j]==1){
continue;
}else{
card[k] = (char*)malloc(6);
strcpy(card[k],str1[i]);
strcat(card[k],str2[j]);
sign[i][j] = 1;
k++;
}
}
return ;
}
void printcards(int n){
int k;
for(k = 0; k < n; k++){
printf("%-10s",card[k]);
}
printf("\n");
return ;
}