struct bus_trip {
/* your variables here */
};
int reserve_trip(struct bus_trip *parg){
/* ... */
/* use your record */
scanf("%s", parg->name);
return 0;
}
int main(){
struct bus_trip trip = {
.idnumber = /* your default, or comuted id */
/* rest of the defualts */
};
reserve_trip(&trip); /* get an address of a variable */
/* rest of your code */
}
One way of doing this, would have be:
struct bus_trip {
/* your variables here */
};
int reserve_trip(struct bus_trip *parg){
/* ... */
/* use your record */
scanf("%s", parg->name);
return 0;
}
int main(){
struct bus_trip trip = {
.idnumber = /* your default, or comuted id */
/* rest of the defualts */
};
reserve_trip(&trip); /* get an address of a variable */
/* rest of your code */
}
发布评论
评论(1)
一种这样做的方法是:
One way of doing this, would have be: