I have this problem with this code, when I compile show me a error in the function gets, this say me that, I can change gets for getw, but when I do it again the machine show me a error. I use C++14
#include<iostream>
using namespace std;
class Maleta{
private:
char *color; //declaracion de variables ---documentando
char *material;
char *marca;
int precio;
public:
void entrada (void); //Declaracion de metodos
void proceso (void);
void salida (void);
};
void Maleta::entrada()
{
cout<<"de color "<<endl;
gets(color);
cout<<"de material"<<endl;
gets(material);
cout<<"de marca"<<endl;
gets(marca);
cout<<"de precio"<<endl;
cin>>precio;
}
void Maleta::salida(void)
{
cout<<"color :"<<color<<endl;
cout<<"material :"<<material<<endl;
cout<<"marca :" <<marca<<endl;
cout<<"precio :"<<precio<<endl;
}
int main()
{
Maleta morral;
morral.entrada();
morral.salida();
}`
I want fix the error with the function gets.