mirror of
https://github.com/kmc7468/cs420.git
synced 2026-11-04 08:10:29 +09:00
add struct example
This commit is contained in:
1 parent
094cbfdd2c
commit
2cd4e3a169
8 files changed
+218
-2
No files matched your search
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user