Tag: 类型为

C中的Shift运算符取代了零而不是零

这是代码: #define u8 char #define u32 unsigned int typedef struct { //decoded instruction fields u8 cond; // Condition (f.ex. 1110 for always true) u8 instruction_code; // Is a constant since we only use branch u32 offset; // Offset from current PC } dcdinst; u8 mem[1024]; mem[0x0] = 0b11101010; u8* instruction_addr = &mem[pc]; if (instruction_addr == […]

无法在C中使用void变量进行编译

test.c的 int main () { void a; return 0; } 我使用gcc编译,但它给了我一个错误: 错误:变量或字段’a’声明为void 从我在这里读到的,我以为我可以毫无问题地声明void变量。