C语言编译出错 ..\HARDWARE\CONTROL\control.c(28): error: #18: expected a ")" c语言编译出错问题

STM32\u7f16\u6309\u952e\u51fa\u73b0..\HARDWARE\key.c(27): error: #18: expected a ")"

..\..\Hardware\src\key.c(75): error: #18: expected a ")"
\u662f\u7531\u4e8e\u60a8\u7684\u5b8f\u5b9a\u4e49
#define key1 GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_2)
\u540e\u9762\u52a0\u4e86\u5206\u53f7
\u3010\u9519\u8bef\uff1a
#define RB4 GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_2)\uff1b
\u3011

#include #include #include #include //\u5168\u5c40\u53d8\u91cfint i, j;int high, width; //\u6e38\u620f\u753b\u9762\u5927\u5c0fint bird_x, bird_y; //\u5c0f\u7403\u7684\u5750\u6807int ball_vx, ball_vy; //\u5c0f\u7403\u7684\u901f\u5ea6void gotoxy(int x, int y) //\u5c06\u5149\u6807\u79fb\u52a8\u5230(x,y)\u4f4d\u7f6e{HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);COORD pos;pos.X = x;pos.Y = y;SetConsoleCursorPosition(handle, pos);}void startup() //\u6570\u636e\u7684\u521d\u59cb\u5316{high = 15;width = 20;bird_x = 0;bird_y = width / 2;ball_vx = 1;ball_vy = 1;}void show() //\u663e\u793a\u753b\u9762{gotoxy(0, 0); //\u5149\u6807\u79fb\u52a8\u5230\u539f\u70b9\u4f4d\u7f6e\uff0c\u4ee5\u4e0b\u91cd\u753b\u6e05\u5c4ffor (i = 0; i < high; i++){for (j = 0; j < width; j++){if ((i == bird_x) && (j == bird_y))printf("0"); //\u8f93\u51fa\u5c0f\u7403elseprintf(" "); //\u8f93\u51fa\u7a7a\u683c}printf("\n");}}void updateWithoutInput() //\u4e0e\u7528\u6237\u8f93\u5165\u65e0\u5173\u7684\u66f4\u65b0{bird_x = bird_x + ball_vx;bird_y = bird_y + ball_vy;if ((bird_x == 0) || (bird_x == high - 1))ball_vx = -ball_vx;if ((bird_y == 0) || (bird_y == width - 1))ball_vy = -ball_vy;Sleep(50);}void updateWithInput() //\u4e0e\u7528\u6237\u8f93\u5165\u65e0\u5173\u7684\u66f4\u65b0{}int main(){startup(); //\u6570\u636e\u7684\u521d\u59cb\u5316while (1) //\u6e38\u620f\u5faa\u73af\u6267\u884c{show(); //\u663e\u793a\u753b\u9762updateWithoutInput(); //\u4e0e\u7528\u6237\u8f93\u5165\u65e0\u5173\u7684\u66f4\u65b0updateWithInput(); //\u4e0e\u7528\u6237\u8f93\u5165\u65e0\u5173\u7684\u66f4\u65b0}return 0;}\u5728vs2017\u4e0b\u8fc7

那个变量、常量,没有定义

~
~
~

AWARE有定义吗?

delay_ms()这个函数的定义过程中可能少了个),你到定义该函数的地方看看

看你的图片是编译器不认识你的AWARE这个标识符呀
它是变量还是宏?在哪里定义的?

看看头文件或者函数周围吧。目前你贴的代码是看不出来什么。

扩展阅读:c语言编译器手机版app ... c语言编译器 中文版 ... c语言程序设计答案 ... c语言& 和 怎么用 ... c语言编译器网页版 ... c语言出错怎么找 ... 流行的c语言编译器 ... c++在线编程平台 ... c#编译器手机版下载 ...

本站交流只代表网友个人观点,与本站立场无关
欢迎反馈与建议,请联系电邮
2024© 车视网