Cpp main 方法 const 声明
Cpp main method const declaration
为什么我们不能在CPP中将main方法声明为const?
int main() const
{
//Some code
}
谁能告诉我为什么?
Why can't we declare main method as const in CPP??
const
限定符只能用于声明 类 的成员函数。它不是非成员函数的选项,main
是一个。
为什么我们不能在CPP中将main方法声明为const?
int main() const
{
//Some code
}
谁能告诉我为什么?
Why can't we declare main method as const in CPP??
const
限定符只能用于声明 类 的成员函数。它不是非成员函数的选项,main
是一个。