Question:
9. Declare a variable of the type defined in Question 8 and initialize it.Answer:
#include<iostream>
using namespace std;
struct fish {
char kind[20];
int weight;
float length;
};
void main() {
fish petes =
{
"trout",
12,
26.25
};
cout
<< petes.kind << endl
<< petes.length << endl
<< petes.weight << endl;
}
0 Questions:
Post a Comment