#include<iostream>
void foo(char* =0);
int main(){
foo("hello,");
try{
foo();
}
catch(...){
std::cout<<"catched"<<std::endl;
}
foo("world!");
system("pause");
return 0;
}
void foo(char *pc){
std::cout<<pc;
}
上面这段程序在dev-c++中编译通过,但运行结果是
hello,
而且没有捕获到异常。
而在vc6.0中结果却是
hello,catched
world!
高手赐教!!