?? ch10_10.cpp
字號(hào):
//***********************
//** ch10_10.cpp **
//***********************
#include <iostream.h>
struct Person
{
char name[20];
unsigned long id;
float salary;
};
void GetPerson(Person& p) //結(jié)構(gòu)參數(shù)引用傳遞的函數(shù)
{
cout <<"Please enter a name for one person:\n";
cin>>p.name;
cout <<"Please enter one's id number and his salary:\n";
cin >>p.id >>p.salary;
}
void Print(Person& p)
{
cout <<p.name <<" "
<<p.id <<" "
<<p.salary <<endl;
}
void main()
{
Person employee[3];
for(int i=0; i<3; i++){
GetPerson(employee[i]); //調(diào)用后,employee[i]被賦值
Print(employee[i]);
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -