how could I find out the size of dynamically allocated array? With normal array using the method below works fine, but I can't do the same thing with dynamically allocated array. Please, have a look and thanks for your help.
#include <iostream>
using namespace std;
int main() {
//normal array
int array[5];
cout << sizeof(array)/sizeof(array[0]) << endl; //this outputs the correct size
//dynamically allocated array
int *dArray = new int[5];
//how to calculate and output the size here?
return 0;
}