avatar
interview questions# Programming - 葵花宝典
j*k
1
【 以下文字转载自 JobHunting 讨论区 】
发信人: jobseek (seeking+jobs), 信区: JobHunting
标 题: interview questions
发信站: BBS 未名空间站 (Mon Nov 19 12:19:42 2007), 转信
1. How can you force instantiation of a template? Explain with example.
2. What is an algorithm (in terms of STL/C++ standard library)?
3: Is anything wrong with the following code fragment:
T *p = 0;
delete p;
avatar
c*g
2
1. make a declaration before the template is really used.
i.e. template class A;
2. a template function work with containers via iterators
3. none

example.

【在 j*****k 的大作中提到】
: 【 以下文字转载自 JobHunting 讨论区 】
: 发信人: jobseek (seeking+jobs), 信区: JobHunting
: 标 题: interview questions
: 发信站: BBS 未名空间站 (Mon Nov 19 12:19:42 2007), 转信
: 1. How can you force instantiation of a template? Explain with example.
: 2. What is an algorithm (in terms of STL/C++ standard library)?
: 3: Is anything wrong with the following code fragment:
: T *p = 0;
: delete p;

avatar
d*d
3
3. 有问题吧.

【在 c*****g 的大作中提到】
: 1. make a declaration before the template is really used.
: i.e. template class A;
: 2. a template function work with containers via iterators
: 3. none
:
: example.

avatar
c*g
4
if no other codes between the two lines, then no.
operator delete can handle a null pointer.

【在 d*******d 的大作中提到】
: 3. 有问题吧.
avatar
c*x
5

example.
1. use static funtion.
2. an algorithm is a function in a predefined template.
3, T is unknow, if T is an array, you need to use delete[]

【在 j*****k 的大作中提到】
: 【 以下文字转载自 JobHunting 讨论区 】
: 发信人: jobseek (seeking+jobs), 信区: JobHunting
: 标 题: interview questions
: 发信站: BBS 未名空间站 (Mon Nov 19 12:19:42 2007), 转信
: 1. How can you force instantiation of a template? Explain with example.
: 2. What is an algorithm (in terms of STL/C++ standard library)?
: 3: Is anything wrong with the following code fragment:
: T *p = 0;
: delete p;

avatar
c*x
6

2, it should be called generic functions.

【在 c********x 的大作中提到】
:
: example.
: 1. use static funtion.
: 2. an algorithm is a function in a predefined template.
: 3, T is unknow, if T is an array, you need to use delete[]

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