title: C++ - Initializing SOCKADDR_IN
body: <p>I am working through some Static Analysis defects and one that is causing me an issue is this one. </p>
  
  <pre><code>SOCKADDR_IN m_stLclAddr;
  </code></pre>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms740496%28v=vs.85%29.aspx" rel="nofollow noreferrer">SOCKADDR_IN is a member of the WinSock API</a></p>
  
  <p>The defect is saying that I have not initialized the following:</p>
  
  <ul>
  <li>m_stLclAddr.sin_port</li>
  <li>m_stLclAddr.sin_zero</li>
  <li>m_stLclAddr.sin_addr</li>
  <li>m_stLclAddr.sin_family</li>
  </ul>
  
  <p>I am not very familiar familiar with the WinSock API but I have done a bit of research and I just want to know if the following line of code would initialize m_stLclAddr with default values?:</p>
  
  <pre><code>m_stLclAddr = { 0 };
  </code></pre>