所以......我早上大部分时间都在处理一段代码.这只是一个小项目,可以帮助我记住语法等等.我显然错过了某种大错误,因为代码因为我不理解的原因返回了一个分段错误.
#include <stdio.h>
#include <stdio.h>
#include <unistd.h>
#include <time.h>
#include <getopt.h>
struct cards
{
int card_value[99];
char card_name[99];
char card_suit[99];
int card_tally;
};
struct cards hand[2];
void tally (int a)
{
int k, j;
for (k=0; k<5; k++)
{
j = j + hand[a].card_value[k];
}
hand[a].card_tally = j;
}
void check_for_ace (int a)
{
int d;
for (d=0; d>5; d++)
{
if (hand[a].card_name[d] =='A')
{
int y;
int z = 10;
for (y=0; y<5; y++)
z = z + hand[a].card_value[y]; …Run Code Online (Sandbox Code Playgroud) c ×1