title: Why does the compiler still warn me about unsafe strtok even after I define _CRT_SECURE_NO_WARNINGS?
body: <p>I am using Visual Studio Express 2012 for Windows Desktop.</p>
  
  <p>I always get error</p>
  
  <pre><code>Error C4996: 'strtok': This function or variable may be unsafe.
    Consider using strtok_s instead.
    To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
    See online help for details.
  </code></pre>
  
  <p>When I try to build the following:</p>
  
  <pre><code>#include "stdafx.h"
  #define _CRT_SECURE_NO_WARNINGS
  #include &lt;iostream&gt;
  #include &lt;cstring&gt;
  using namespace std;
  int main() {
      char the_string[81], *p;
      cout &lt;&lt; "Input a string to parse: ";
      cin.getline(the_string, 81);
      p = strtok(the_string, ",");
      while (p != NULL) {
          cout &lt;&lt; p &lt;&lt; endl;
          p = strtok(NULL, ",");
      }
      system("PAUSE");
      return 0;
  }
  </code></pre>
  
  <p>Why am I getting this error even though I define <code>_CRT_SECURE_NO_WARNINGS</code>, and how do I fix it?</p>