If I were to create an array with int* array = new int[10]; and fill part of the array with values, how can I check how much of the array is filled? I want to l
This is how to set a default value in C++ when making an array.
int array[100] = {0};
Now every element is set to 0. Without doing this every element it garbage and will be undefined behavior if used.
Not all languages are like this. Java has default values when declaring a data structure but C++ does not.