#include<iostream>
using namespace std;
struct box{
char maker[40];
float height;
float width;
float length;
float volume;
};
void show(box b);
void addr(box *);
int main(){
box B;
B = {
"DIAO",
1,
2,
3,
4 };
show(B);
addr(&B);
cout << B.volume;
system("PAUSE");
return 0;
}
void show(box b){
cout << b.maker;
cout << b.height;
cout << b.length;
cout << b.volume;
cout << b.width;
}
void addr(box *b){
cout << b->maker;
cout << b->height;
cout << b->length;
b->volume = 8;
cout << b->width;
}
using namespace std;
struct box{
char maker[40];
float height;
float width;
float length;
float volume;
};
void show(box b);
void addr(box *);
int main(){
box B;
B = {
"DIAO",
1,
2,
3,
4 };
show(B);
addr(&B);
cout << B.volume;
system("PAUSE");
return 0;
}
void show(box b){
cout << b.maker;
cout << b.height;
cout << b.length;
cout << b.volume;
cout << b.width;
}
void addr(box *b){
cout << b->maker;
cout << b->height;
cout << b->length;
b->volume = 8;
cout << b->width;
}