gpt4 book ai didi

c - typedef 结构错误 : expected a ';'

转载 作者:行者123 更新时间:2023-11-30 21:09:47 25 4
gpt4 key购买 nike

#pragma once
typedef struct __attribute__((packed)) {
} msg_gps_time_t;

我有这段代码,它给出了以下错误:需要一个“;”该代码预计可以工作,因为我从第三方获得了它作为教程的一部分。

最佳答案

应该是:

typedef struct  {
} __attribute__((packed)) msg_gps_time_t;

属性必须位于结构声明之后。

关于c - typedef 结构错误 : expected a ';' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33583421/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com