title: strcpy_s in c++
body: <p>I am new to C++ . I am writing following simple code. I wanted to pass the character[40] into a function and then get the same as output.
  If i put a debug at following point.
   strcpy_s(x,100,tester);</p>
  
  <p>But it only takes "This" if i write "This is sent at the output". Can anyone please point out what am i missing and whats the reason for only accepting few characters.</p>
  
  <pre><code>// BUSTesting.cpp : Defines the entry point for the console application.
  //
  
  #include "stdafx.h"
  #include &lt;iostream&gt;
  #include "resource.h"
  
  int testFunction(char* tester);
  int _tmain()
  {
  
      char m[40];
      std::cin&gt;&gt;m;
      testFunction(m);
  }
  int testFunction(char* tester)
  {
  
      char x[100] ;
      memset(x,100,sizeof(x));
      strcpy_s(x,100,tester);
      std::cout&lt;&lt;x;
      return 0;
  }
  </code></pre>