c - 错误 : expected ‘)’ before ‘?’ token

标签 c compiler-errors syntax-error

因此,即使我正在编译的代码没有“?”,我也会收到此错误消息根本。 我使用 gcc 作为我的编译器和链接器。关于为什么会发生这种情况的任何提示?

此外,当我从函数名称中删除“l”时,错误消失了。我很困惑。

出现错误的代码片段:

unsigned long htonl(unsigned long ll) //Says error is on this line
{
    UDWord x;
    UDWord y;

    x.ul = ll;
    y.uc[0] = x.uc[3];
    y.uc[1] = x.uc[2];
    y.uc[2] = x.uc[1];
    y.uc[3] = x.uc[0];
    return y.ul;
}

最佳答案

htonl 有时在 gcc 的标准包含文件中定义为宏。使用不同的名称。

关于c - 错误 : expected ‘)’ before ‘?’ token,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16975599/

相关文章:

python - PYTHON语法错误吗?

parsing - 在guards haskell中使用case表达式时解析错误

c - 使 openssl RSA 算法具有确定性

c - 从函数中重新分配结构中的动态数组

arrays - 创建矩阵 - "Value update is not a member of Example.Matrix"错误

java - 类型中的方法不适用于参数

无缘无故发生Java错误 "This method must return a result of type string"

rust - 为什么编译器不能解析 "a as u32 < b"或类似的?

c - 在 C 中使用递归的直角三角形

c - IA32 到 Y86 汇编代码转换