I have problems reading a string in c ++.
Since the strings do not have a character limit (they are dynamic), I thought I would read them with gets in the following way:
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
string Descripcion;
cout<<"Ingrese la descripcion del Producto: ";
gets(Descripcion);
cout<<"La Descripcion del producto es: "<<Descripcion<<endl;
return 0;
}
But code :: blocks 16.01 tells me:
|10|error: cannot convert 'std::string {aka std::basic_string<char>}' to 'char*' for argument '1' to 'char* gets(char*)'|
Is there a way to read a string without setting limits?