#include <stdio.h>
#include <stdlib.h>
typedef struct{
char *name;
char *city;
int age;
}data;
int addName(data *d){
d->name = "lady gaga";
return 0;
}
int addCity(data *d){
d->city = "new york";
return 0;
}
int addAge(data *d){
d->age = 24;
return 0;
}
int main(int c){
system("color 5f");
data* list;
list = (data*) malloc(1*sizeof(data));
addName(list);
addCity(list);
addAge(list);
printf("%s, %d of %s",list->name, list->age, list->city);
return 0;
}
#include <stdlib.h>
typedef struct{
char *name;
char *city;
int age;
}data;
int addName(data *d){
d->name = "lady gaga";
return 0;
}
int addCity(data *d){
d->city = "new york";
return 0;
}
int addAge(data *d){
d->age = 24;
return 0;
}
int main(int c){
system("color 5f");
data* list;
list = (data*) malloc(1*sizeof(data));
addName(list);
addCity(list);
addAge(list);
printf("%s, %d of %s",list->name, list->age, list->city);
return 0;
}
No comments:
Post a Comment