c-exercises/structs.c
2013-06-09 18:54:43 +02:00

19 lines
275 B
C

#include <assert.h>
struct test {
int foo;
};
typedef struct test test_t;
int main(int argc, char * argv[]) {
test_t a = { 23 };
test_t b = { 42 };
a = b;
assert(a.foo == 42);
assert(b.foo == 42);
a.foo = 69;
assert(a.foo == 69);
assert(b.foo == 42);
}