hey, if you could just check out my code, i've spent soo long on it already, and i cant seem to figure out WHY this doesnt work when the code for the functions is pretty simliar!
all im doing is getting input from the stream and storing into a variable.
Code:
//animals.h
class animals {
public:
void set_title(string);
void set_G(string);
private:
string G;
string title;
};
//animals.cpp
//...
void Item::set_title(string x) {
title = x;
}
void Item::set_G(string x) {
G = x;
}
Code:
//main.cpp
// ...
Animals * temp;
string title;
string G;
out << "Enter title: ";
getline(in, title);
temp->set_title(title);
out << "Enter genre: ";
getline(in,G);
temp->set_G(G); //segfaults right here