Question:
Write a code fragment that dynamically allocates a structure of the type described in Question 8 and then reads a value for the kind member of the structure.Answer:
struct fish{
char kind[20];
int weight;
float length;
};
fish * pole = new fish;
cout << "Enter kind of fish: ";
cin >> pole->kind;
0 Questions:
Post a Comment