Last active
April 9, 2018 14:39
-
-
Save ErnyTech/b5977599fed80536534ce3b7d1e6b2c2 to your computer and use it in GitHub Desktop.
This file contains 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 <stdlib.h> | |
#include <stdio.h> | |
void increment_age(int *age_plus); | |
int main() { | |
char str[200]; | |
int age; | |
int *age_plus; | |
age_plus=&age; | |
printf("Inserisci la tua eta': "); | |
fgets(str, 200, stdin); | |
age = (int) strtol(str, NULL, 10); | |
increment_age(age_plus); | |
printf("La tua eta' aumentata: %d", *age_plus); | |
} | |
void increment_age(int *age_plus) { | |
*age_plus = (*age_plus * 2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment