Skip to content

Instantly share code, notes, and snippets.

@Warwolt
Created April 10, 2019 13:02
Show Gist options
  • Save Warwolt/ccb0b3c5a581f2ab70058b1251cc9d55 to your computer and use it in GitHub Desktop.
Save Warwolt/ccb0b3c5a581f2ab70058b1251cc9d55 to your computer and use it in GitHub Desktop.
struct Point
{
int x;
int y;
};
translate_point_diagonally(Point *p, int amount)
{
p->x += amount;
p->y += amount;
}
void main(void)
{
Point my_point = {1, 2};
translate_point_diagonally(&my_point, 5); // my_point = {6, 7}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment