defer
This commit is contained in:
parent
00f39ac9ca
commit
77ca7b179c
3 changed files with 29 additions and 11 deletions
18
tests/functions.c
Normal file
18
tests/functions.c
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
int add(int x, int y);
|
||||
int main(void);
|
||||
|
||||
|
||||
int add(int x, int y) {
|
||||
return (x + y);
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
int sum = add(5, 3);
|
||||
struct T id = identity(42);
|
||||
return sum;
|
||||
}
|
||||
|
||||
|
|
@ -2,12 +2,10 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
struct Point {
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
|
||||
int main(void);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,21 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
struct Number {
|
||||
int value;
|
||||
int value;
|
||||
};
|
||||
|
||||
char *Number_show(struct Number self);
|
||||
char* Number_show(struct Number self);
|
||||
int main(void);
|
||||
|
||||
char *Number_show(struct Number self) { return "number"; }
|
||||
|
||||
char* Number_show(struct Number self) {
|
||||
return "number";
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
struct Number number = (struct Number){.value = 40};
|
||||
Number_show(number);
|
||||
return 0;
|
||||
struct Number number = (struct Number){ .value = 40 };
|
||||
Number_show(number);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue