![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Template project for University of York ELE00032C Lab 4
Diff: main.cpp
- Revision:
- 2:3e6493621bc9
- Parent:
- 1:8290f84652d1
diff -r 8290f84652d1 -r 3e6493621bc9 main.cpp --- a/main.cpp Sat Jan 16 22:10:24 2021 +0000 +++ b/main.cpp Sat Jan 16 22:26:51 2021 +0000 @@ -5,13 +5,22 @@ int y; }; +unsigned long long modSquared(IntVector vector) { + return vector.x*vector.x + vector.y*vector.y; +} + int main() { IntVector p; + IntVector q; p.x = -3; p.y = 1; - printf("(%d, %d)\r\n", p.x, p.y); + q = p; + q.x = 4; + + printf("(%d, %d). Mod-squared %llu\r\n", q.x, q.y, modSquared(q)); + printf("(%d, %d). Mod-squared %llu\r\n", p.x, p.y, modSquared(p)); // Do nothing, forever... while (true);