由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 来几个C++测试题
相关主题
int F::*x = &F::x是什么意思?C++ Q05: pointer to constant variable
不如各位高手挑个专题讲讲C++11吧C++ Q93 - Q95 (转载)
Question about a C++ compilation error on Visual Studio 2005int *a [] 和int (*a)[] 一样吗
C里面有没有default argument这么一说,是不是只有在C++里有这个feature?c++ 里用到pointer 的地方我们尽可能用smart pointer吗?
Default function template argumentsGo adopts JavaScript’s idea of semicolon insertion
Why do I need to use "plain" pointer?shared_ptr处理stack上面的指针
is smart_ptr really that good?c++太神奇了
pointer overflowc++ size_t 一问
相关话题的讨论汇总
话题: default话题: arguments话题: pointer话题: function话题: type
进入Programming版参与讨论
1 (共1页)
l*0
发帖数: 19
1
是个面试测试题,下面几个都拿不准,大家讨论啊!
Which of the following statements regarding default arguments of functions
are correct?
A. Default arguments can never precede non-default arguments
B. Default arguments are not considered for generating the function's
signature
C. Default arguments cannot be of pointer type
D. Default arguments exist in the global heap and not on the function's
stack
E. Default arguments cannot be of a user-defined type
A?
which of the following is not a unary operator?
A. !
B. %
C. +
D.
g****n
发帖数: 14
2
Which of the following statements regarding default arguments of functions
are correct?
A. Default arguments can never precede non-default arguments
Yes.
B. Default arguments are not considered for generating the function's
signature.
No. The default values are not considered for generating the function's
signature. The type of the formal arguments are included in the function's
signature.
C. Default arguments cannot be of pointer type
No.
D. Default arguments exist in the global heap and not on
f******n
发帖数: 90
3

Where are the values of the default arguments stored?
how to use it as a unary?
-
a
A
This syntax looks strange, can you write a complete statement to show how
to use it?

【在 g****n 的大作中提到】
: Which of the following statements regarding default arguments of functions
: are correct?
: A. Default arguments can never precede non-default arguments
: Yes.
: B. Default arguments are not considered for generating the function's
: signature.
: No. The default values are not considered for generating the function's
: signature. The type of the formal arguments are included in the function's
: signature.
: C. Default arguments cannot be of pointer type

g****n
发帖数: 14
4
write a reference name r to a pointer to an array of 5 integers
This syntax looks strange, can you write a complete statement to show how to
use it?
In C++, a pointer to an array usually means a pointer to the first element
of the array.
int (*&r)[5]; is also OK. But you need to use (*r)[i] to access the i-th
element.
1 (共1页)
进入Programming版参与讨论
相关主题
c++ size_t 一问Default function template arguments
matlab: how to set defaul value for function argumentsWhy do I need to use "plain" pointer?
三个C syntax 弱问题is smart_ptr really that good?
a question abou dll, 3x!!pointer overflow
int F::*x = &F::x是什么意思?C++ Q05: pointer to constant variable
不如各位高手挑个专题讲讲C++11吧C++ Q93 - Q95 (转载)
Question about a C++ compilation error on Visual Studio 2005int *a [] 和int (*a)[] 一样吗
C里面有没有default argument这么一说,是不是只有在C++里有这个feature?c++ 里用到pointer 的地方我们尽可能用smart pointer吗?
相关话题的讨论汇总
话题: default话题: arguments话题: pointer话题: function话题: type