Answer the question
In order to leave comments, you need to log in
Error entering a string in a class, how to solve?
The following error pops up
:
#pragma once
#include <iostream>
#include <string>
using namespace std;
class Producer_of_Fuel
{
public:
Producer_of_Fuel();
~Producer_of_Fuel();
void set_name_producer();
void set_country();
void get_name_producer();
void get_country();
protected:
string name_producer[20];
string country[20];
};
void Producer_of_Fuel::set_country()
{
cout << "Pls, write country of producer" << endl;
cin >> country;
}
void Producer_of_Fuel::set_country()
{
cout << "Pls, write country of producer" << endl;
cin >> country[20];
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question