在C++头文件定义并初始化一个 int 数组 为什么不可以!!!! 急急急,在线等!

2025-04-14 11:11:37
推荐回答(1个)
回答(1):

Of course you can.


Here is my code based on your question!

#include
using namespace std;

int main(){
    int a[] = {0,0,0};

    for (int i=0; i<3; i++){
        cout << a[i] << endl;
    }
    return 0;
}