Skip to content

Instantly share code, notes, and snippets.

@ErnyTech
Last active April 9, 2018 14:39
Show Gist options
  • Save ErnyTech/b5977599fed80536534ce3b7d1e6b2c2 to your computer and use it in GitHub Desktop.
Save ErnyTech/b5977599fed80536534ce3b7d1e6b2c2 to your computer and use it in GitHub Desktop.
#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