What is the proper signature of the main function in C++? What is the correct return type, and what does it mean to return a value from main? What are the allowed parameter types, and what are their meanings?
这是系统特定的吗?这些规则会随着时间而改变吗?如果我违反它们会发生什么?
在C/C++中,main函数接收类型的参数char*.
int main(int argc, char* argv[]){
return 0;
}
Run Code Online (Sandbox Code Playgroud)
argv是一个数组char*,并指向字符串.这些字符串在哪里?它们是堆,堆栈还是其他地方?