When i allocate dynamically a char* of 256 array for example, i thought that its size is 256 bytes.
But sizeof() always gives back the size of a char*.
So how would i go to get the size allocated?
Code:#include <iostream>
using namespace std;
int main()
{
char * buf = new char[256];
cout << sizeof(buf) <<"\n";
delete [] buf;
return 0;
}