hello i just to know how to define an array...
when using a variable...
for example...

cin >> numb;

int an_array[numb]

when i try it...it tells me
cannot allocate an array of constant size 0
and
unknown size
...
so could you please tell me how do it ???

Arrays have to be constant.

Try vector<int>, or allocate the memory and delete it at the end.

int *an_array;

 /*input*/

an_array = new int [numb];

/*stuff*/

delete [] an_array;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.