mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-15 23:18:48 +00:00
Reorganize tests
This commit is contained in:
18
examples/c/struct2.c
Normal file
18
examples/c/struct2.c
Normal file
@@ -0,0 +1,18 @@
|
||||
typedef struct {
|
||||
char a;
|
||||
struct {
|
||||
int b[4];
|
||||
};
|
||||
long c;
|
||||
} Temp;
|
||||
|
||||
int main() {
|
||||
const Temp temp = {1, {{2, 3, 4, 5}}, 6};
|
||||
|
||||
Temp temp2;
|
||||
temp2 = temp;
|
||||
|
||||
int sum = temp2.a + temp2.b[2] + temp2.c;
|
||||
|
||||
return sum == 11;
|
||||
}
|
||||
Reference in New Issue
Block a user