Created
December 15, 2022 18:54
-
-
Save lopesivan/a5fc33f1182d55b9463e214dff377eac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
struct speed { | |
int x; | |
int y; | |
}; | |
void aumenta(struct speed *speed); | |
void aumenta(struct speed *speed){ | |
speed->x += 10; | |
speed->y += 10; | |
} | |
int main(int argc, char *argv[]) | |
{ | |
struct speed speed = {10,4}; | |
/* struct speed speed = {.x=10,.y=3}; */ | |
printf("Velocidade X=%d, Y=%d\n", speed.x, speed.y); | |
aumenta(&speed); | |
printf("Velocidade X=%d, Y=%d\n", speed.x, speed.y); | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment