title: strcpy compiles on Windows but it doesn't on Linux
body: <p>I'm learning C++ and trying to write universal code (sorry, I don't know how you call the code that can compiles on Windows, Linux, MacOS, etc.).</p>
  
  <p>I have written the function trimLeft:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  const string rows = "rows:";
  const string columns = "cols:";
  const string data = "data:";
  
  struct dimensions {
      int rows;
      int columns;
  };
  
  inline bool exists (const string&amp; name) {
      ifstream f(name.c_str());
      return f.good();
  }
  
  string trimLeft(const string&amp; input) {
  
      if ((input.empty()) || 
          ((input.at(0) != ' ') &amp;&amp; (input.at(0) != '\t')))
          return input;
      else {
          char * tab2 = new char[input.length() + 1];
          char *trimmed = new char[input.length() + 1];
  
          strcpy(tab2, input.c_str());
  
          bool skip = true;
          int pos = 0;
  
          for (unsigned int i = 0; i &lt; (input.length() + 1); i++) {
              if (skip) {
                  if ((tab2[i] == ' ') || (tab2[i] == '\t'))
                      continue;
                  else {
                      skip = false;
  
                      trimmed[pos] = tab2[i];
                      pos++;
                  }
              }
              else {
                  trimmed[pos] = tab2[i];
  
                  if (tab2[i] == '\0')
                      break;
                  else
                      pos++;
              }
          }
  
          string stringTrimmed(trimmed);
  
          return stringTrimmed;
      }
  }
  </code></pre>
  
  <p>It <strong>compiles</strong> on Windows showing this warning:</p>
  
  <blockquote>
    <p>warning C4996: 'strcpy': This function or variable may be unsafe.
    Consider using strcpy_s instead. To disable deprecation, use
    _CRT_SECURE_NO_WARNINGS.</p>
  </blockquote>
  
  <p>But in Linux, with the following command:</p>
  
  <blockquote>
    <p>g++ FormatMatrix.cpp -o format</p>
  </blockquote>
  
  <p>I get:</p>
  
  <pre><code>error: ‘strcpy’ was not declared in this scope
  </code></pre>
  
  <p>Are headers different on each operating system?</p>
  
  <p><strong>NOTE</strong>:<br/> And please, stop voting negative: I've got the message.</p>