Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 00003 struct IntVector { 00004 int x; 00005 int y; 00006 }; 00007 00008 unsigned long long modSquared(IntVector vector) { 00009 return vector.x*vector.x + vector.y*vector.y; 00010 } 00011 00012 int main() { 00013 IntVector p; 00014 IntVector q; 00015 00016 p.x = -3; 00017 p.y = 1; 00018 00019 q = p; 00020 q.x = 4; 00021 00022 printf("(%d, %d). Mod-squared %llu\r\n", q.x, q.y, modSquared(q)); 00023 printf("(%d, %d). Mod-squared %llu\r\n", p.x, p.y, modSquared(p)); 00024 00025 // Do nothing, forever... 00026 while (true); 00027 }
Generated on Thu Jul 21 2022 17:27:22 by
1.7.2