add struct example

This commit is contained in:
Janggun Lee
2022-11-21 18:09:33 +09:00
parent 094cbfdd2c
commit 2cd4e3a169
8 changed files with 218 additions and 2 deletions

19
examples/c/struct4.c Normal file
View File

@@ -0,0 +1,19 @@
int nonce = 1; // For random input
struct Foo
{
int x;
};
struct Foo f()
{
struct Foo x;
x.x = nonce;
return x;
}
int main()
{
int x = f().x;
return x;
}