gpt4 book ai didi

c - 错误 : expected ‘=’ , ‘,’ , ‘;’ , ‘asm’ 或 ‘__attribute__’ 数字常量前

转载 作者:太空宇宙 更新时间:2023-11-04 05:21:02 26 4
gpt4 key购买 nike

我遇到了错误src/sr_main.c:在函数“main”中:src/sr_main.c:72: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ 数字常量src/sr_main.c:72: 警告:语句无效src/sr_main.c:81: error: ‘natEnabled’ undeclared (first use in this function

我不知道为什么会出现此错误。一切似乎在语法上都是正确的。

59 int main(int argc, char **argv)
60 {
61 int c;
62 char *host = DEFAULT_HOST;
63 char *user = 0;
64 char *server = DEFAULT_SERVER;
65 char *rtable = DEFAULT_RTABLE;
66 char *filter = DEFAULT_FILTER;
67 char *template = NULL;
68 unsigned int port = DEFAULT_PORT;
69 unsigned int topo = DEFAULT_TOPO;
70 char *logfile = 0;
71 struct sr_instance sr;
72 int natEnabled 0;
73
74 printf("Using %s\n", VERSION_INFO);
75
76 while ((c = getopt(argc, argv, "hs:n:v:p:u:t:r:l:T:")) != EOF)
77 {
78 switch (c)
79 {
80 case 'n':
81 natEnabled =1;
82 break;
83 case 'h':
84 usage(argv[0]);
85 exit(0);
86 break;

最佳答案

是的,听编译器,你需要int natEnabled=0;

关于c - 错误 : expected ‘=’ , ‘,’ , ‘;’ , ‘asm’ 或 ‘__attribute__’ 数字常量前,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8347752/

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