#include <stdio.h>
#include <limits.h>
#include <stdbool.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdarg.h>
//auteur : Raphael De Oliveira
struct personne{
int age;
char* nom;
char* prenom;
};
void clear(struct personne * p){
p->age=0;
}
int main(int argc, char *argv[]){
struct personne *p1 = malloc(sizeof(struct personne));
p1->age = 2;
p1->nom = "De OLiveira";
p1->prenom = "Raphael";
printf("L'age de p1 est : %d\n",p1->age);
printf("Le prenom est : %s\n",p1->prenom);
printf("Le nom de p1 est : %s\n",p1->nom);
clear(p1);
printf("L'age de p1 apres la fonction clear est : %d\n",p1->age);
return 0;
}
Add a code snippet to your website: www.paste.org