Commit d3c6f826 authored by Wilke Pierre's avatar Wilke Pierre
Browse files

tests pointeurs

parent 4b02b59d
void f(int* z, int x, int y){
*z = x + y;
}
int main(int x, int y){
int z = 3;
f(&z, x, y);
return z;
}
{"output": "", "error": null, "retval": 26}
\ No newline at end of file
{"output": "", "error": null, "retval": 3}
\ No newline at end of file
SYM_VOID
SYM_IDENTIFIER(f)
SYM_LPARENTHESIS
SYM_INT
SYM_ASTERISK
SYM_IDENTIFIER(z)
SYM_COMMA
SYM_INT
SYM_IDENTIFIER(x)
SYM_COMMA
SYM_INT
SYM_IDENTIFIER(y)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_ASTERISK
SYM_IDENTIFIER(z)
SYM_ASSIGN
SYM_IDENTIFIER(x)
SYM_PLUS
SYM_IDENTIFIER(y)
SYM_SEMICOLON
SYM_RBRACE
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_INT
SYM_IDENTIFIER(x)
SYM_COMMA
SYM_INT
SYM_IDENTIFIER(y)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_INT
SYM_IDENTIFIER(z)
SYM_ASSIGN
SYM_INTEGER(3)
SYM_SEMICOLON
SYM_IDENTIFIER(f)
SYM_LPARENTHESIS
SYM_AMPERSAND
SYM_IDENTIFIER(z)
SYM_COMMA
SYM_IDENTIFIER(x)
SYM_COMMA
SYM_IDENTIFIER(y)
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RETURN
SYM_IDENTIFIER(z)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
int main(){
int x = 0;
int *y = &x;
int** z = &y;
**z = 3;
return x;
}
{"output": "", "error": null, "retval": 3}
\ No newline at end of file
{"output": "", "error": null, "retval": 3}
\ No newline at end of file
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_RPARENTHESIS
SYM_LBRACE
SYM_INT
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_INTEGER(0)
SYM_SEMICOLON
SYM_INT
SYM_ASTERISK
SYM_IDENTIFIER(y)
SYM_ASSIGN
SYM_AMPERSAND
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_INT
SYM_ASTERISK
SYM_ASTERISK
SYM_IDENTIFIER(z)
SYM_ASSIGN
SYM_AMPERSAND
SYM_IDENTIFIER(y)
SYM_SEMICOLON
SYM_ASTERISK
SYM_ASTERISK
SYM_IDENTIFIER(z)
SYM_ASSIGN
SYM_INTEGER(3)
SYM_SEMICOLON
SYM_RETURN
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment