表:
id | year | score
-----+------+-----------
12 | 2011 | 0.929
12 | 2014 | 0.933
12 | 2010 | 0.937
12 | 2013 | 0.938
12 | 2009 | 0.97
13 | 2010 | 0.851
13 | 2014 | 0.881
13 | 2011 | 0.885
13 | 2013 | 0.895
13 | 2009 | 0.955
16 | 2009 | 0.867
16 | 2011 | 0.881
16 | 2012 | 0.886
16 | 2013 | 0.897
16 | 2014 …Run Code Online (Sandbox Code Playgroud) 当我尝试运行它时,我收到了分段错误(核心转储).它完美编译,但我得到错误,我不知道为什么.我试图以所有可能的方式编辑我的代码,但我仍然收到此错误.我已经没有想法了.任何帮助都会很棒.谢谢!
unsigned short *reg = NULL;
int byte;
int i;
for (byte = 0; byte < num_bytes; byte++){
unsigned int next_byte = (unsigned int) message[byte];
crc_byte(reg, key, next_byte);
}
for (i = 0; i < 16; i++){
crc_bit(reg, key, 0);
}
return *reg;
}
Run Code Online (Sandbox Code Playgroud) 我有一个辅助函数.
enum recstate {
initial,
};
struct client {
enum recstate state;
}
Run Code Online (Sandbox Code Playgroud)
这是我的主要代码:
struct client *p;
p->state = initial;
Run Code Online (Sandbox Code Playgroud)
一切正常,直到我尝试执行以下if语句:
if(p->state == initial){
Run Code Online (Sandbox Code Playgroud)
我真的不明白为什么.非常感谢.谢谢!