Skip to content
Snippets Groups Projects
Commit 4430289f authored by zhaochaoyi's avatar zhaochaoyi
Browse files

fix bug AND and OR %left in IF

parent a3fcd93a
No related branches found
No related tags found
No related merge requests found
Showing
with 135 additions and 0 deletions
Error type 6 at Line 4: The left-hand side of an assignment must be a variable "="
int main()
{
float j;
10 + j;
}
\ No newline at end of file
Error type 7 at Line 4: Type mismatched for operands ""
int main()
{
float j = 1.7;
return j;
}
\ No newline at end of file
Error type 8 at Line 4: Type mismatched for return "return"
int func(int i)
{
return i;
}
int main()
{
func(1, 2);
}
\ No newline at end of file
Error type 9 at Line 8: Function is not applicable for arguments ""
int func(int a);
int func(int a)
{
return 1;
}
int main()
{
}
\ No newline at end of file
struct Position
{
float x, y;
};
int func(int a);
int func(struct Position p);
int main()
{
}
\ No newline at end of file
Error type 19 at Line 8: Inconsistent declaration of function "func"
Error type 18 at Line 6: Undefined function "func"
int func()
{
int i = 10;
return i;
}
int main()
{
int i;
i = func();
}
\ No newline at end of file
int func()
{
int i = 10;
return i;
}
int main()
{
int i;
int i, j;
i = func();
}
\ No newline at end of file
Error type 3 at Line 10: Redefined variable "i"
struct Temp1
{
int i;
float j;
};
struct Temp2
{
int x;
float y;
};
int main()
{
struct Temp1 t1;
struct Temp2 t2;
t1 = t2;
}
\ No newline at end of file
struct Temp1
{
int i;
float j;
};
struct Temp2
{
int x;
};
int main()
{
struct Temp1 t1;
struct Temp2 t2;
t1 = t2;
}
\ No newline at end of file
Error type 5 at Line 16: Type mismatched for assignment "="
// 1-10
struct A{
int aa;
};
struct A func1(){return 1.0;} // 8
struct A func1(){return 1;} // 8 4
int Func(){
return 1;
}
int main(){
struct A a1;
int a1; //3
float f = 1 + 100; //5
int ai[100];
float fi[100];
variable = func(); //1 2
101 = f; // 6
if (a + 100 == 1) //7
Func();
Func(a1[100]); //9 10
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment