why wont the computer recognize gets()

48 views Asked by At
#include <iostream>
#include <cstdio>

using namespace std;

int main() {
    char str[100];
    cout << "Enter a string: ";
    gets(str);
    cout << "You entered: " << str;

    return 0; 
}

This is code sample has been coppied exactly form programiz.com and i have no idea how this works I am learning c++ and i wanted to see how the gets function works in action. whenever i try to run this code it says that the identifier is unidentified... I think that either the header cstdio or the function gets has been outdated, but there must be some way to access a string with whitespaces... please help.

0

There are 0 answers