title: Initializing char buffer in c++
body: <p>I am writing application on c++ and using intel inspector to do memory profiling.</p>
  
  <p>However i have a question about the various results that i got during my memory profiling test for finding potential memory problems.</p>
  
  <p>I am trying to do a better stable application and i have few questions I know they are basics still at this time looking too much into the code i am kind of confused. Thank you for the help in getting them clarfied.</p>
  
  <ol>
  <li>should i initialize char buffer[30] to a default value ?</li>
  <li>what should be the default vaue for the LPWSTR (I tried NULL) still it complains uninitialized memory access on my member variable.</li>
  <li>Initialize a struct. I tried using memset. Still the profiler looks unhappy and complains uninitialized memory access.</li>
  </ol>
  
  <p>One instance is 
  In my caller class constructor i have initialized the handle as</p>
  
  <pre><code>m_hidHandle = NULL; //member variable and an object of struct hid_device
  </code></pre>
  
  <p>After which i make a call to do hid_write.</p>
  
  <p>And in there, hid_write which inturns calls writeFile (this is the api class hid.c)</p>
  
  <pre><code>WriteFile(dev-&gt;device_handle, buf, length, NULL, NULL);
  </code></pre>
  
  <p>Here i get a complain that uninitialized memory access.
  I even tried checking the api documentation for WrtieFile. Still unclean what i am making it to complain about
  a memory problem.</p>
  
  <p>Another instance is 
  I have a member variable</p>
  
  <pre><code>WINHTTP_CURRENT_USER_IE_PROXY_CONFIG m_pConfig;
  </code></pre>
  
  <p>In the constructor, I am trying to initialize the struct to NULL:</p>
  
  <pre><code>memset( &amp;m_pConfig, 0, sizeof(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG) );
  </code></pre>
  
  <p>It complained uninitialized memory access. I even tried</p>
  
  <pre><code>//proxyConfig.fAutoDetect = false;
  //proxyConfig.lpszAutoConfigUrl = NULL;
  //proxyConfig.lpszProxy = NULL;
  //proxyConfig.lpszProxyBypass = NULL;
  </code></pre>
  
  <p>Still no help.</p>