When passing an array to a function and using sizeof() in the fuction, it just returns the size of a single element (4). Is there a way to fix this? And I'm limited to only using arrays, not vectors/templates.
void arraysize(int arr[]){
cout << sizeof(arr) << endl;
}
int main(){
int a[15];
arraysize(a); //4
cout << sizeof(a) << endl; //60
}
Output:
4
60