问题 问答题 简答题

请说出函数参数为一般变量的复制传递方式、地址传递方式和引用方式的异同点。

答案

参考答案:复制传递方式是实参的数据拷贝给了形参变量,实参和形参是具有相同数据类型但存储空间是不同的两组空间。在复制传递方式下,被调用函数里对形参的操作不能改变实参的内容。

地址传递方式和复制传递方式正好相反,用函数的参数本身传给被调用函数。被调用函数中对形参的操作将直接改变实参的值。调用函数将实参的地址传送给被调用函数,被调用函数对该地址的目标操作即对实参本身的操作。按地址传递,实参为变量的地址,而形参为同类型的指针。

引用方式和地址传递方式的效果一样,但引用更直接、更方便。按引用传递,实参为变量,形参为同类型的引用。采用引用方式实参和形参使用的是相同的内存空间,只是名称不同而已。

完形填空
阅读下面短文,根据所读内容在表格中的空白处填入恰当的单词。注意:每个空格只填写一个单词。
Traveling to all corners of the world gets easier and easier. We live in a global village ,but this doesn’t mean that we all behave in the same way.
How should we behave when you meet someone for the first time? An American shakes your hand firmly while looking you straight in the eye. In many part of Asia, there is no physical contact (接触)at all. In Japan, you should bow, and the more respect you want to show, The deeper you should bow. In Thailand, people greet each other by pressing both hands together at the chest, In both countries, eye contact is avoided as a sign of respect.
Many country have rules about what you should and shouldn’t wear. In Muslim countries, you shouldn’t reveal (显露)the body, especially women, who Should wear long blouses and skirts .In Korea ,you should take off your shoes when entering a house Remember to place then neatly together where you came in.
In Spain, lunch is often the biggest meal of the day, and can last two or three hours. For this reason many people eat a light breakfast and a late dinner. In Mexico, Lunch is the time to relax, and many people prefer not to discuss business as they eat ,In Britain ,it’s not unusual to have a business meeting over breakfast.
In most countries, an exchange of business cards is necessary for all introductions. You should include your company name and your position. If you are going to a country where your language is not widely spoken, you can get the back side of your card printed in the local language. In China ,you may present your card with the writing facing the person you are giving it to.
Title :good小题1:    
Aspect
Country
Custom
  Greeting
·America
·Japan
·Thailand
■Shaking hands firmly
■小题2:_____to show respect
Dressing
·小题3:___Countries
·Korea
Wearing long blouses and skirts
Taking off your shoes at the
小题4:_________
小题5:
___________
·Spain
·Mexico
小题6:_______
■Having a light breakfast and a late dinner
■Relaxing while having 小题7:______
■Holding a business meeting over breakfast
Doing business
·Most countries
·China
■Exchanging business cards when小题8:____yourself
■Presenting a card to a person小题9:_______it’s front facing him
Conclusion : When traveling小题10:_______,we should follow local customs.
 
单项选择题