How can I print an array that is based on values of integers inside of it ?
Do you mean you want to display the content of a C-style array but you don’t know its size?
If that’s the question, I usually follow one of these two solutions:
a) I do *not* use C-style arrays, unless I’m forced by a gun aimed at my head - but even in that case, I hesitate :-)
I use vectors instead.
b) I try to discover my array size by sizeof.
The size of an array is equal to the number of elements it contains, so it’s its overall size divided by the size of one element.