问题 单项选择题

若函数调用时的实参为变量时,以下关于函数形参和实参的叙述中正确的是

A.函数的实参和其对应的形参共占同一存储单元

B.形参只是形式上的存在,不占用具体存储单元

C.同名的实参和形参占同一存储单元

D.函数的形参和实参分别占用不同的存储单元

答案

参考答案:D

解析: 在内存中,实参单元与形参单元是不同的单元。在C语言中,仅在调用函数时,给形参分配存储单元,并将实参对应的值传递给形参,调用结束后,形参单元被释放,实参单元仍保留并维持原值。

阅读理解

Almost everyone likes dogs, and almost everyone likes to read about dogs. I have friend. He has a big police dog with the name Jack. Police dogs are very clever. Every Sunday afternoon my friend takes jack for along walk in the park. Jack likes these long walks very much. One Sunday afternoon a young man came to visit my friend. He stayed a long time. He talked and talked. Soon it was time for my friend to take Jack for walk. But the visitor still stayed. Jack became much worried. He walked around the room several times and then sat down in front of the visitor and looked at him. But the visitor paid no attention to Jack. He went on talking. At last Jack got angry. He went out of the room and came back a few minutes later. He sat down again in front of the visitor, but this time he took the visitor’s cap in his mouth.

小题1: The young visitor stayed a long time in my friend’s house, didn’t he?

A.Yes, he was.

B.Yes, he did.

C.No, he wasn’t.

D.No, he didn’t.小题2:Jack became worried because _______ .

A.he wanted to go out for a walk

B.he wanted to play with him

C.he didn’t know the young man

D.he wanted to eat something小题3:Jack sat down in front of the visitor because he wanted _____.

A.the visitor to talk with him

B.to join the talk

C.to show the visitor how clever he was

D.the visitor to leave the house soon小题4:The visitor went on talking and ______.

A.he didn’t like Jack

B.he paid no attention to his cap

C.he didn’t know that his cap was taken away by Jack

D.he paid no attention to Jack小题5:At last Jack took ______ in his mouth.

A.food

B.nothing

C.the visitor’s cap

D.the visitor’s bag

阅读理解与欣赏