well Satan911 first of all thanx for your support this time the answer seems to be something like this:
#include <iostream>
struct inflatable
{
char name[20];
float volume;
double price;
};
int main()
{
using namespace std;
inflatable guests[2] = // initializing an array of structs
{
{“Bambi”, 0.5, 21.99}, // first structure in array
{“Godzilla”, 2000, 565.99} // next structure in array
};
cout << “The guests “ << guests[0].name << “ and “ << guests[1].name
<< “\nhave a combined volume of “
<< guests[0].volume + guests[1].volume << “ cubic feet.\n”;
return 0;
}
well I tried to code the answer but I get an error here we go:
#include <iostream>
struct barsnames
{
char candyname[20];
float weight;
int calories;
};
int main()
{
using namespace std;
barsnames hi[2] =
{
{"snack",0},
{"weight",2.3,0}
{"calories",350}
};
cout << "CandyName: " << hi[0].candyname << " , weight: " << hi[1].weight << " , calories: " << hi[2].calories;
cout << endl;
system("pause");
return 0;
}
look at :
{"snack",0},
{"weight",2.3,0}
{"calories",350}
I think that I did something wrong there it should look like this:
{"snack",here comes something},
{"2.3",her comes something}
{"350",here comes something}
well from the book we have got this:
inflatable guests[2] = // initializing an array of structs
{
{“Bambi”, 0.5, 21.99}, // first structure in array
{“Godzilla”, 2000, 565.99} // next structure in array
};
Idk what are those numbers but I doubt that are something related with memory store