69,371
社区成员
发帖
与我相关
我的任务
分享
#include<stdio.h>
struct fish {
const char *name;
const char *species;
int teeth;
int age;
} ;
void catalog(struct fish f)
{
printf("%s is a %s with %i teeth. He is %i.\n", f.name, f.species, f.teeth, f.age);
}
void label(struct fish f)
{
printf("Name: %s\nSpecies: %s\n%i years old,\n%i teeth\n", f.name, f.species, f.teeth, f.age);
}
int main()
{
struct fish snappy = {"Snappy", "Piraha", 69, 4};
catalog(snappy);
label(snappy);
return 0;
}