vendredi 24 avril 2020

Variable-sized object may not be initialized problem in array

When I try to run this simple code, it returns a Variable-sized object may not be initialized error. I have no idea why and how to resolve this problem. Please help.

using namespace std;
int main(int argc, const char * argv[]) {
    // insert code here...
    int n=0;
    n=1;
    int a[n]={}, b[n]={};
    return 0;
}

Aucun commentaire:

Enregistrer un commentaire