title: What is the difference between wcsncpy and wcscpy_s?
body: <p>Is there any practical difference between using <code>wcscpy_s</code> and using <code>wcsncpy</code>? The only difference seems to be the order of parameters and return value:</p>
  
  <pre><code>errno_t wcscpy_s(wchar_t *strDestination,
                   size_t numberOfElements,
                   const wchar_t *strSource);
  
  wchar_t *wcsncpy(wchar_t *strDest,
                   const wchar_t *strSource,
                   size_t count );
  </code></pre>
  
  <p>And if there is no practical difference, why did Microsoft need to add <code>wcscpy_s</code> to Visual Studio, when <code>wcsncpy</code> was already available and a standard function?</p>
  
  <p>Is it OK to replace <code>wcscpy_s</code> to <code>wcsncpy</code> when porting from Visual Studio to gcc?</p>