title: C++ scanf was not declared in this scope
body: <p>Here's my code </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdio.h&gt;
  
  using namespace std;
  
  int main()
  {
      long long int N = 0, product, sum;
      int t; scanf_s("%d", &amp;t);  //// ERROR STARTS AT THIS LINE
      while (t--)
      {
          sum = 0;
  
          scanf_s("%d", &amp;N);
          N = N / 2;
  
          product = 1;
          sum = 1; 
          for (int i = 1; i &lt;= N; i++)
          {
              product = product * i;
              sum += product;
          }
  
          printf("%d \n", sum);
      }
      return 0;
  }
  </code></pre>
  
  <p>I get this <strong>compiling error</strong> when submitting solution to www.codechef.com</p>
  
  <pre><code>prog.cpp: In function 'int main()':
  prog.cpp:9:25: error: 'scanf_s' was not declared in this scope
    int t; scanf_s("%d", &amp;t);
  </code></pre>
  
  <p>I have tried compiling with <code>C++ (gcc-4.3.2)</code>, <code>(C++ gcc-4.9.2)</code> and <code>C++ 14 (g++4.9.2)</code>, didn't work.
  Why..? I have included <code>&lt;stdio.h&gt;</code>. </p>