由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - C++ Q03:
相关主题
不用头文件,如何调用函数?C++脚本语言 vs 编译语言
function declarationFP的教材是怎么误导人的
namespace defined in another fileC++里 variable declaration 有什么用?
有没有static return type和static as function arguement?C++ help: 一个multiple definition problem.
code swarm (video)如何在C里面call C++的routine呢
interview questionsc function 在 c里调用和C++调用结果不一样
在子函数内开内存,返回主函数指针然后释放空间是不是很糟糕的(转载)[合集] 如果在自己的程序里调用external program (C++/Linux)
C++ software engineer 3 years expectationC++ questions
相关话题的讨论汇总
话题: namespace话题: class话题: c++话题: names话题: extern
进入Programming版参与讨论
1 (共1页)
c**********e
发帖数: 2007
1
Which type of construct do you use to logically group names that can be
shared across multiple source files?
a. class
b. extern
c. namespace
d. #include
e. typedef
X****r
发帖数: 3557
2
I see you have been posting these basic C++ questions.
Just curious -- are you looking for answers, or just to test other
people here?

【在 c**********e 的大作中提到】
: Which type of construct do you use to logically group names that can be
: shared across multiple source files?
: a. class
: b. extern
: c. namespace
: d. #include
: e. typedef

c**********e
发帖数: 2007
3
我知道答案。讨论的目的是加深一下理解,理解透彻了不容易忘。
欢迎新手讨论,高手指点。

【在 X****r 的大作中提到】
: I see you have been posting these basic C++ questions.
: Just curious -- are you looking for answers, or just to test other
: people here?

E*U
发帖数: 2028
4
c

【在 c**********e 的大作中提到】
: Which type of construct do you use to logically group names that can be
: shared across multiple source files?
: a. class
: b. extern
: c. namespace
: d. #include
: e. typedef

r****t
发帖数: 10904
5
我怎么觉得 a,b,c,e 都可以,只要能在 header 里面用就可以的不是。
c 其实是 group names that are already dispersed across multiple source files.
d**e
发帖数: 6098
6
b吧

【在 c**********e 的大作中提到】
: Which type of construct do you use to logically group names that can be
: shared across multiple source files?
: a. class
: b. extern
: c. namespace
: d. #include
: e. typedef

c********t
发帖数: 1756
7
那位高手讲讲答案!
G****A
发帖数: 4160
8
my answer (d)

【在 c**********e 的大作中提到】
: Which type of construct do you use to logically group names that can be
: shared across multiple source files?
: a. class
: b. extern
: c. namespace
: d. #include
: e. typedef

c**********e
发帖数: 2007
9
The answer is c) namespace.
This is the purpose of namespaces. They provide logical groupings of
identifiers. The result of using a namespace is similar to what could be
accomplished using a class with all static members. However, unlike a class
, a namespace can be reopened to include additional identifiers.

a) class
This is incorrect. Much more than a logical grouping of names is provided by
"class." See other comments.

b) extern
1 (共1页)
进入Programming版参与讨论
相关主题
C++ questionscode swarm (video)
C++ Q15: throwinterview questions
求助,C++调用C 函数 的 LNK 2019 Error在子函数内开内存,返回主函数指针然后释放空间是不是很糟糕的(转载)
inline到底能省多少时间?C++ software engineer 3 years expectation
不用头文件,如何调用函数?C++脚本语言 vs 编译语言
function declarationFP的教材是怎么误导人的
namespace defined in another fileC++里 variable declaration 有什么用?
有没有static return type和static as function arguement?C++ help: 一个multiple definition problem.
相关话题的讨论汇总
话题: namespace话题: class话题: c++话题: names话题: extern