我寫的代碼是關於黑色的插口。 我無法編譯它,它會發生警告。 多字符字符常量和隱式常量轉換溢出 任何人都可以告訴我發生了什麼事情。 我已經想了很久,plz幫助我。多字符字符常量和溢出中隱式常量轉換
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int flower;
int k;
int add [13]={1,2,3,4,5,6,7,8,9,10,10,10,10};
char flower_all [4]={'\3','\4','\5','\6'};
char number_all [13]={'A','2','3','4','5','6','7','8','9','10','J','Q','K'};
char player_f[13],player_n[13];
char com_f[13],com_n[13];
int poker [52]={0};
int i,j,y,num,ans;
int player_p=0,com_p=0;
void wash(){
int k;
k=rand()%52;
while(poker[k]==1)
{
k=rand()%52;
}
poker[k]=1;
}
void give_card_p(){
char player_f[13],player_n[13];
int i,k;
int ans;
printf("請問是否要補牌? 1:要 2:不要");
scanf("%d",&ans);
fflush(stdin);
while (ans==1){
wash();
player_f[i]=flower_all[k/13];
player_n[i]=number_all[k%13];
player_p+=add[k%13];
continue;
if (player_p>21)
break;
}
}
int main(){
srand(time(0));
char player_f[13],player_n[13];
int k;
for(i=0;i<2;i++){
wash();
player_f[i]=flower_all[k/13];
player_n[i]=number_all[k%13];
player_p+=add[k%13];
}
for (i=0;i<2;i++){
wash();
com_f[i]=flower_all[k/13];
com_n[i]=number_all[k%13];
com_p+=add[k%13];
}
printf("%c%c",player_f[i],player_n[i]);
fflush(stdin);
return 0;
}
請考慮創建一個[mvce](http://stackoverflow.com/help/mcve)。也請包括任何錯誤信息的完整文本,並指出它失敗的行。 –