I am very new to C++ , and I am wandering why this code:
void display(int display[]){
for(int i=0;i<sizeof(display)/sizeof(int);i++){
cout<<display[i];
}
}
int main()
{
int arr[]={3,1,2,5,10,20};
display(arr);
}
prints only the first 2 elements from the array ? why not all of them? Am I missing something?