问题 填空题

类中包含了一个静态成员函数,则main函数中和P.f1(P);语句具有同样功能的语句为______。
#include<iostream.h>
class M
public:
M(int A)A=a;B+=a;
static void f1(M m);
private:
int A;
static int B;;
void M::f1(M m)

cout<<“A=“<<m.A((end1;
cout<<“B=”<<m.B<<end1;

int M::B=10;
void main()

M P(5);
P.f1(P);

答案

参考答案:M::f1(P);。

解析: 由于f1是类M的静态成员函数,即说明类M的任何对象都共享一份f1,因此,不仅可以从对象那里访问f1,还可以用域操作符::通过类名来访问。

完形填空
完形填空。
     Beautiful pictures of mountains and forests, clear skies, flying birds, wild animals, silly faces - you can
find them all in one place.  1 ? On a postcard! Have people always sent postcards? No! Before postcards,
people  2   sealed (密封的) letters.
     The  3  for the first decorated (装饰的) postcard came to John P. Charlton in 1861. He thought a simple
card  4  a border would be a great way to send a note. Then in the late 1800s, postcards which had pictures
on them  5 . By law, people had to write their note on the front-on the picture! The back was  6  for the
address. Several years later, England allowed a divided-back (背面隔开的) postcard. Then people could write
their  7  on the back left side. And they put the address  8 . During the early 1900s, the golden age of postcards,
people around the world were more and more  9  picture postcards. In 1908, Americans alone mailed over
677 million postcards.
     Today, postcards are the  10  most popular collection in the world after stamps and coins. You can always
see or get a lot of newly-designed postcards, especially on New Year's Day.
( )1. A. How         
( )2. A. liked       
( )3. A. advice      
( )4. A. above       
( )5. A. happened    
( )6. A. even        
( )7. A. note        
( )8. A. on the front
( )9. A. surprised at
( )10. A. first      
B. When         
B. hated        
B. picture      
B. with         
B. changed      
B. only         
B. word         
B. on the back  
B. interested in
B. second       
C. Why        
C. found      
C. idea       
C. under      
C. ended      
C. still      
C. address    
C. on the left
C. expected by
C. third      
D. Where        
D. lost         
D. card         
D. for          
D. appeared     
D. ever         
D. letter       
D. on the right                  
D. worried about
D. fourth       
多项选择题