Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question