I have the following code:
int* y = new int[n];
where n's value will be provided by the user at runtime. I need to know the total memory size that i have allocated to y.
What function i will use? Wonder if i can use the sizeof operator? Also i i use the sizeof operator in such a situation as:
int x[10];
cout<<sizeof(x) ;
then it returns 40. What is 40 exactly?
int* y = new int[n];
where n's value will be provided by the user at runtime. I need to know the total memory size that i have allocated to y.
What function i will use? Wonder if i can use the sizeof operator? Also i i use the sizeof operator in such a situation as:
int x[10];
cout<<sizeof(x) ;
then it returns 40. What is 40 exactly?
Comment