So ive been making arrays this way but i found a error, lets say it was a loop that copied and array element by element:
int v1[] = { 3, 4, 7, 8};
int v2[sizeof(v1)];
for (auto i = 0; i < sizeof(v2); ++i)
{
v2[i] = v1[i]
}
The v2 array will not have the size of 4 integers, it adds them all up. So v2 would have the size of 22 not 4 integers. So i was wondering if there was any way of finding the size of an array without having to go to the array and see how many there elements there are manually. Is there a way? thanks.