samedi 5 décembre 2020

Expression have must a constant value in c++ [duplicate]

I am asking why in this case i should have a constant value in A[size] , but i can't find the answer.

int size;
    cout << "Enter number of elements";
    cin >> size;

    int A[size];

    cout << sizeof A << endl;

Aucun commentaire:

Enregistrer un commentaire