N
N
NikSIk312019-05-27 19:08:35
Code::Blocks
NikSIk31, 2019-05-27 19:08:35

Why is it crashing?

There is a code
string buffStr, f;
int buffInt;
int buffDate[3];
Detail item[10];
cout << "Input detailName: ";
cin >> buffStr;
item[5].setName(buffStr);
cout << endl;
crashes after entering a name.
name description code:
class Detal {
std::string detalName;
int detalSort, detalDate[3], detalQuant, detalCost;
public:
std::string setName(std::string detalName);
std::string getName();
};
function description code:
#include "Detal.h"
std::string Detal::setName(std::string detalName){
this->detalName = detalName;
};
std::string Detail::getName(){
return this->detalName;
};

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question