Answer the question
In order to leave comments, you need to log in
How to insert class objects into a vector and display the properties of objects from the class on the screen?
I now have a task to bring a class object into a vector, and then display the properties of the object that are in the vector on the screen.
But so far I have no idea in which direction to dig. If anyone can help, please point me in the right direction.
For example, I will attach the class code:
class Tasks
{
private:
std::string m_Name;
std::string m_Desc;
unsigned short m_Status;
public:
Tasks(std::string Name, std::string Desc, unsigned short Status = 0) : m_Name{ Name = "None" }, m_Desc{ Desc = "None" }
{
m_Status = Status;
}
Tasks()
{
m_Name = "None";
m_Desc = "None";
m_Status = 4; // Тестовое значение
}
// Методы Tasks
// Геттеры
std::string get_m_Name() { return m_Name; }
std::string get_m_Desc() { return m_Desc; }
unsigned short get_m_Status() { return m_Status; }
// Изменение данных класса
void change_Name_Tasks();
void change_Desc_Tasks();
void change_Status_Tasks();
void cout_Tasks();
};
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