由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - [合集] 也说个C++面题
相关主题
C++ interdependence questionA C++ compiler related interview question
what's wrong with this C++ code?Why do I need to use "plain" pointer?
ask a simple question about int pointer.is smart_ptr really that good?
C++小插曲pointer overflow
为什么大部分C or C++都在linux下做?C++ Q05: pointer to constant variable
急问:compile and build dependencyC++ Q93 - Q95 (转载)
static initialization dependency c++int F::*x = &F::x是什么意思?
C arrayc++ 里用到pointer 的地方我们尽可能用smart pointer吗?
相关话题的讨论汇总
话题: c++话题: 面题话题: compiler
进入Programming版参与讨论
1 (共1页)
s*******e
发帖数: 664
1
☆─────────────────────────────────────☆
ilvch (From here to eternity) 于 (Thu Jun 18 17:49:47 2009, 美东) 提到:
class A {
public:
void foo(){};
};
int main()
{
A* a=0;
a->foo();
}
可以么?
☆─────────────────────────────────────☆
SETI (天青如水,飞龙在天) 于 (Thu Jun 18 17:56:43 2009, 美东) 提到:
不可以吧,编译能通过,但是运行时会出错。

☆─────────────────────────────────────☆
ilvch (From here to eternity) 于 (Thu Jun 18 18:10:01 2009, 美东) 提到:
我回答是因为没有this pointer
不过据说是compiler dependent, non standard
☆──────────────────────
1 (共1页)
进入Programming版参与讨论
相关主题
c++ 里用到pointer 的地方我们尽可能用smart pointer吗?为什么大部分C or C++都在linux下做?
不如各位高手挑个专题讲讲C++11吧急问:compile and build dependency
Go adopts JavaScript’s idea of semicolon insertionstatic initialization dependency c++
A tech question (转载)C array
C++ interdependence questionA C++ compiler related interview question
what's wrong with this C++ code?Why do I need to use "plain" pointer?
ask a simple question about int pointer.is smart_ptr really that good?
C++小插曲pointer overflow
相关话题的讨论汇总
话题: c++话题: 面题话题: compiler