title: Buffer size: N*sizeof(type) or sizeof(var)? C++
body: <p>I am just starting with cpp and I've been following different examples to learn from them, and I see that buffer size is set in different ways, for example:</p>
  
  <pre><code>char buffer[255];
  StringCchPrintf(buffer, sizeof(buffer), TEXT("%s"), X);
  </code></pre>
  
  <p><strong><em>VS</em></strong></p>
  
  <pre><code>char buffer[255];
  StringCchPrintf(buffer, 255*sizeof(char), TEXT("%s"), X);
  </code></pre>
  
  <p><strong>Which one is the correct way to use it?</strong> </p>
  
  <p><em>I've seen this in other functions like  InternetReadFile, ZeroMemory and MultiByteToWideChar.</em></p>