相关疑难解决方法(0)

如果(条件)在C++中尝试{...}合法吗?

例如:

if (true) try
{
    // works as expected with both true and false, but is it legal?
}
catch (...)
{
    // ...
}
Run Code Online (Sandbox Code Playgroud)

换句话说,将if -block放在if条件之后是否合法?

c++ exception try-catch language-lawyer

44
推荐指数
4
解决办法
5997
查看次数

标签 统计

c++ ×1

exception ×1

language-lawyer ×1

try-catch ×1