avatar
来几个C++测试题# Programming - 葵花宝典
l*0
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.
avatar
g*n
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
avatar
f*n
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

avatar
g*n
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.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。