Visual C++ not identifying gets_s
<p>So this is a simple program for practice.</p>

<pre><code>#include "stdafx.h"
#include "iostream"
#include "conio.h"
#include "stdio.h"

using namespace std;

class book
{
    int bookno;
    char bookt[20];
    float price;
    float totalcost(int n)
    {
        float tot;
        tot = n * price;
        return tot;
    }
public:
    void input()
    {
        cout &lt;&lt; "\nEnter book number: ";
        cin &gt;&gt; bookno;
        cout &lt;&lt; "\nEnter book title: ";
        gets_s(bookt);                    //Does not identify this.
        cout &lt;&lt; "\nEnter book price: ";
        cin &gt;&gt; price;
    }
    void purchase()
    {
        int n;
        float total;
        cout &lt;&lt; "\nEnter the number of books to be purchase: ";
        cin &gt;&gt; n;
        total = totalcost(n);
        cout &lt;&lt; "\nTotal amount is: " &lt;&lt; total;
    }
};

int _tmain(int argc, _TCHAR* argv[])
{
    book B1;
    B1.input();
    B1.purchase();
    _getch();
    return 0;
}
</code></pre>

<p>The compiler (Visual C++ 2010) does not identify <code>gets_s</code>. Identifying in the sense, it just skips the input field in output as follows:</p>

<pre><code>OUTPUT

Enter book number: 5

Enter book title:
Enter book price: 5

Enter the number of books to be purchased: 5

Total amount is: 25
</code></pre>

<p>It just doesn't give me time to enter the book title and runs booktitle and bookprice at the same time. Help.</p>
