参数和形参之间是什么关系?
What is the relationship between arguments and formal parameters?
将一个方法的形参设置为常量
清单6 .int形参定义类。
在第三对中,形参列表只有默认实参不同。
In the third pair, the parameter lists differ only in their default arguments.
在方法主体用来给参数值作为占位符中的变量叫做形参。
Within the body of a method, the variables that act as placeholders for the argument values are called formal parameters.
它跟在构造函数的形参表之后,以冒号开关。
It follows the constructor parameter list and begins with a colon.
编译器将选出形参个数和类型都与实参匹配的函数。
The compiler selects those functions that have the required number of parameters and for which the argument types match the parameter types.
将指定实参连接(绑定)到静态结构图中某个模板的形参。
Connects (binds) designated arguments to a template's formal parameters in your Static Structure diagram.
构造函数的形参指定了创建类类型对象时使用的初始化式。
The constructor's parameters specify the initializers that may be used when creating objects of the class type.
在整个标准库中,经常使用形参为一对迭代器的构造函数。
The constructors that take a pair of iterators are an example of a common form used extensively throughout the library.
因为数组不能复制,所以无法编写使用数组类型形参的函数。
Because we cannot copy an array, we cannot write a function that takes an array type parameter.
最后,清单6显示了int形参值的形参定义子类的部分实现。
Finally, Listing 6 shows a partial implementation of the parameter definition subclass for int parameter values.
通常,将数组形参直接定义为指针要比使用数组语法定义更好。
It is usually a good idea to define array parameters as Pointers, rather than using the array syntax.
框架的边上要标明函数的名字,框内填写函数内部的形参和变量。
A frame is a box with the name of a function beside it and the parameters and variables of the function inside it.
对于上述几种情况,有效的解决办法是将形参定义为引用或指针类型。
In these cases we can instead define the parameters as references or Pointers.
为了确定最佳匹配,编译器将实参类型到相应形参类型转换划分等级。
In order to determine the best match, the compiler ranks the conversions that could be used to convert each argument to the type of its corresponding parameter.
论述了汽车配光镜面形参自动检测系统设计的原理、电路结构及测试结果。
Have expounded the principle that the automatic detection system of automobile lamp geometry shape is designed, circuit structure and test result.
由于忽略了数组长度,形参定义中如果包含了数组长度则特别容易引起误解。
Because an array dimension is ignored, including a dimension in a parameter definition is particularly misleading.
在向函数传递大型对象时,需要使用引用形参,这是引用形参适用的另一种情况。
The other circumstance in which reference parameters are useful is when passing a large object to a function.
可以用单个实参来调用的构造函数定义了从形参类型到该类类型的一个隐式转换。
A constructor that can be called with a single argument defines an implicit conversion from the parameter type to the class type.
出现在相同作用域中的两个函数,如果具有相同的名字而形参表不同,则称为重载函数。
Two functions that appear in the same scope are overloaded if they have the same name but have different parameter lists.
最后剩下的部分就是处理错误报告(例如一个未知的形参标记字符或者一个超出范围的数字值)。
The only part remaining is the handling of error reporting (such as an unknown parameter flag character or a numeric value out of range).
根据实参个数选出潜在的可行函数后,必须检查实参的类型是否与对应的形参类型匹配。
Having used the number of arguments to winnow the potentially viable functions, we must now look at whether the argument types match those of the parameters.
一个类可以有多个构造函数,每个构造函数必须有与其他构造函数不同数目或类型的形参。
A class can have multiple constructors. Each constructor must differ from the others in the number or types of its parameters.
如果两个函数声明的返回类型和形参表完全匹配,则将第二个函数声明视为第一个的重复声明。
If the return type and parameter list of two functions declarations match exactly, then the second declaration is treated as a redeclaration of the first.
每次调用函数时,都会重新创建该函数所有的形参,此时所传递的实参将会初始化对应的形参。
Each parameter is created anew on each call to the function. The value used to initialize a parameter is the corresponding argument passed in the call.
每次调用函数时,都会重新创建该函数所有的形参,此时所传递的实参将会初始化对应的形参。
Each parameter is created anew on each call to the function. The value used to initialize a parameter is the corresponding argument passed in the call.
应用推荐