问题 单项选择题

下列对变量的引用中,错误的是

A.int a; int &p=a;

B.char a; char &p=a;

C.int a; int &p;p=a;

D.float a; float &p=a;

答案

参考答案:C

解析: 本题考核引用的定义和初始化。引用具有如下特点:引用能够使用任何合法变量名;引用不是变量,所以必须在定义时初始化,而且一旦初始化之后,就不能再成为其他变量的引用;引用不是值,不占存储空间,说明引用时,目标的存储状态不会改变。所以,引用只有说明,没有定义; 引用仅在说明时带有“&”,以后就像普通变量一样使用,不能再带“&”。在C选项中,由于在定义引用p后没有进行初始化,所以此语句错误。

单项选择题
阅读理解

Here are some advertisements taken from a newspaper.

(1) Dear Drew Carter,

Your first year on this earth has been a pleasure ride for all of us. We love you!

Love,

Dad and Mom and many friends.

(2)Lawlis-Clarke

The Doctors Virgil and Marjorie Lawlis are pleased to announce the engagement(订婚) of their daughter Diane Susan to Mr.Robert Brent Clarke,son of Mr.and Mrs.James Clarke of Herford,Texas.

A spring wedding is planned in Houston.

(3) Isbell-Foss

Mr.and Mrs.Davis K.Isbell announce the marriage of their daughter Dang to Mr.Stanley Foss,son of Mrs.John Sipe of Ada,Minnesota.

The wedding will be early April at Abiding Love Lutheran Church.

(4)  Story-Kurio

Miss Stephanie Story and Mr.Warren Kurio were married February 5,at half past seven o’clock in the evening at Highland Park Presbyterian Church in Dallas,Texas.The bride(新娘) is the daughter of Mr.and Mrs.Herbert Brule Story Jr.of Dallas.The groom(新郎)is the son of Mr.and Mrs.Gerald Stanley Kurio of Austin.

小题1:What would be the best title for the first advertisement?

A.We Love You

B.Happy 1st Birthday

C.One Year Old

D.Our One-Year-Old Son小题2:Lawlis and Clarke are going to get married_________.

A.in a church

B.where Clarke’s parents live

C.against their parents’ will

D.to Lawlis’s parents’ joy小题3:Who got or will get married in spring?

A.Not only Lawlis and Clarke but also Isbell and Foss.

B.Neither Lawlis and Clarke nor Isbell and Foss.

C.Either Isbell and Foss or Story and Kurio.

D.Neither Lawlis and Clarke nor Story and Kurio.