Why there is a size difference between calling a parameterized array and calling?
Actually I've seen that, when I try to define an array it's better to allocate the size after defining the index size. So, to define the size that way I wrote this... #include<bits/stdc++.h> using namespace std; main() { int *array,size; cout<<"The size of the array pointer: "<<sizeof(array)<<endl; cout<<"Enter the size of your array: "; cin>>size; array=new int[size]; cout<<"The size of the array pointer: "<<sizeof(array)<<endl; // During the compilation the above line of code is ignored & won't shown in the Console. cout<<"Enter elements:"<<endl; for(int i=0;i<size;i++) { cin>>array[i]; } cout<<"Your array: "; for(int i=0;i<size;i++) { cout<<array[i]<<" "; } cout<<endl<<"The size of the array pointer: "<<sizeof(array)<<endl; } But, from the beginning the size of the array shows 8 Bytes, while each integer takes 4 bytes of memory. I've no problem while storing an array of any size. It works as same as a parameterized array. But, my question is why it took only 8 bytes of memory?