Andy Pomfret
/
UoY-32C-lab4-1
Template project for University of York ELE00032C Lab 4
Diff: main.cpp
- Revision:
- 1:8290f84652d1
- Parent:
- 0:77209603a6fe
- Child:
- 2:811646ac034f
diff -r 77209603a6fe -r 8290f84652d1 main.cpp --- a/main.cpp Mon Jan 11 11:28:11 2021 +0000 +++ b/main.cpp Sat Jan 16 22:10:24 2021 +0000 @@ -1,15 +1,18 @@ #include "mbed.h" -int main() -{ - int x = 4; - x = 6; - int y; - y = 2*x; - x = 7; - - printf("x:%d y:%d\n", x, y); - - // Do nothing, forever... - while (true); +struct IntVector { + int x; + int y; +}; + +int main() { + IntVector p; + + p.x = -3; + p.y = 1; + + printf("(%d, %d)\r\n", p.x, p.y); + + // Do nothing, forever... + while (true); }