title: C++ Size of char* buffer
body: <p>Is there a way to determine the size of a <code>char[]</code> buffer via a <code>char*</code> pointer in C++? I'm using C++98.</p>
  <p>The following lines of code all print out '8' (essentially <code>sizeof(char*)</code>). However I'm looking for the actual size of the buffer.</p>
  <pre><code>int maxBufferLen = 24;
  char* buffer = new char[maxBufferLen];
  
  std::cout &lt;&lt; sizeof(buffer) &lt;&lt; std::endl; // prints '8'
  std::cout &lt;&lt; ( sizeof(buffer) / sizeof(buffer[0]) ) &lt;&lt; std::endl; // prints '8'
  </code></pre>
  <p>In practice, I am passing that <code>char*</code> buffer in between functions and I will not have access to the <code>maxBufferLen</code> variable that I am using to initialize it. As such, I'll need to determine the length using another way.</p>