h*****g 发帖数: 312 | 1 Which one of the following function declarations do you use for a function
that takes a variable number of parameters and uses all of them?
A.
void function (first, others[]);
B.
void function(argc, *argv[]);
C.
void function(...);
D.
void function(int first, ...);
E.
void[] function();
觉得b,d 都行啊~ |
l******l 发帖数: 66 | 2 Strictly speaking, b takes two parameters. |
m****v 发帖数: 84 | 3 d
and it can be compiled? |
p******r 发帖数: 2999 | 4 why not?
【在 m****v 的大作中提到】 : d : and it can be compiled?
|
s******c 发帖数: 1920 | 5 void function(...);
这个传的啥参数?没见过这样的啊。 |
j**w 发帖数: 382 | 6
You must see before, but forgot now. The following is the most famous one
int printf( const char *format ,…)
【在 s******c 的大作中提到】 : void function(...); : 这个传的啥参数?没见过这样的啊。
|
d*****d 发帖数: 46 | 7 for b, maybe the reason is you are not using all of them. Anybody will use
the first argument?
【在 l******l 的大作中提到】 : Strictly speaking, b takes two parameters.
|
m****v 发帖数: 84 | 8
i mean, maybe only d can be compiled, so we have to select d?
【在 p******r 的大作中提到】 : why not?
|
h*****g 发帖数: 312 | 9 对 答案给的是d
【在 m****v 的大作中提到】 : : i mean, maybe only d can be compiled, so we have to select d?
|
n******0 发帖数: 61 | 10 can anybody implement one for me? |
|
|
d********t 发帖数: 9628 | 11 B and C?
【在 h*****g 的大作中提到】 : Which one of the following function declarations do you use for a function : that takes a variable number of parameters and uses all of them? : A. : void function (first, others[]); : B. : void function(argc, *argv[]); : C. : void function(...); : D. : void function(int first, ...);
|
d********t 发帖数: 9628 | 12 I think D is only valid in C, not C++.
【在 h*****g 的大作中提到】 : 对 答案给的是d
|
S**I 发帖数: 15689 | 13 it is valid in C++
【在 d********t 的大作中提到】 : I think D is only valid in C, not C++.
|
d********t 发帖数: 9628 | 14 But in C++ function() means taking no parameter at all.
【在 S**I 的大作中提到】 : it is valid in C++
|
t****t 发帖数: 6806 | 15 http://www.mitbbs.com/article/Programming/31211775_3.html
免得大家瞎猜.
【在 h*****g 的大作中提到】 : Which one of the following function declarations do you use for a function : that takes a variable number of parameters and uses all of them? : A. : void function (first, others[]); : B. : void function(argc, *argv[]); : C. : void function(...); : D. : void function(int first, ...);
|
B******5 发帖数: 4676 | |
a********m 发帖数: 15480 | 17 这句话没看懂。c里面也一样吧。
【在 d********t 的大作中提到】 : But in C++ function() means taking no parameter at all.
|
a*****n 发帖数: 158 | |
q****x 发帖数: 7404 | 19 a, b,e直接淘汰。
c/d不清楚。瞎蒙一个也有50%胜率。
【在 t****t 的大作中提到】 : http://www.mitbbs.com/article/Programming/31211775_3.html : 免得大家瞎猜.
|