c语言 expression syntax

来源:百度知道 编辑:UC知道 时间:2024/05/29 10:35:57
int x=4;
int y=65;
int *q;
q=loca_card(int &x,int &y);

int *loca_card(int &x,int &y)
{
int j=0;
int i=0;
int mycard[2];
int *q;
q=mycard;
unsigned int keycode;
while(1){
if((keycode=all_key())==DOWN_ARROW&&i<=0){
i=i+1;
y=y+60;
setcolor(WHITE);
rectangle(x,y-60,x+40,y-10);
setcolor(GREEN);
rectangle(x,y,x+40,y+50);
}

if(keycode==UP_ARROW&&i>0){
i=i-1;
y=y-60;
setcolor(WHITE);
rectangle(x,y+60,x+40,y+110);
setcolor(GREEN);
rectangle(x,y,x+40,y+50);
line(535,85+j*50,625,85+j*50);

}

if(keycode==RIGHT_ARROW&&j<=6){
j=j+1;
x=x+50;
setcolor(WHITE);
rectangle(x-50,y,x-10,y+50);
setcolor(GREEN);
rectangle(x,y,x+40,y+50);
}

函数要先声明后才能使用。
你在写q=loca_card(int &x,int &y); 这条语句的时候,编译器还不知道loca_card(int &x,int &y)这个函数。你可以把你的这条语句放到最后来写,或者在这条语句之前加上函数声明int *loca_card(int &x,int &y);

一、C语言中Expression syntax in function main 的意思是在主函数当中表达式语法错误。
二、下面为C语言的错误大全及中文解释:
1: Ambiguous operators need parentheses — 不明确的运算需要用括号括起
2: Ambiguous symbol xxx — 不明确的符号
3: Argument list syntax error — 参数表语法错误
4: Array bounds missing — 丢失数组界限符
5: Array size toolarge — 数组尺寸太大
6: Bad character in paramenters — 参数中有不适当的字符
7: Bad file name format in include directive — 包含命令中文件名格式不正确
8: Bad ifdef directive synatax — 编译预处理ifdef有语法错
9: Bad undef directive syntax — 编译预处理undef有语法错
10: Bit field too large — 位字段太长
11: Call of non-function — 调用未定义的函数
12: Call to function with no prototype — 调用函数时没有函数的说明
13: Cannot modify a const object — 不允许修改常量对象
14: Case outside of switch — 漏掉了case 语句
15: Case syntax error — Case 语法错误
16: Code has no effect — 代码不可能执行到