I built a class, compiled it with no problems but windows dos wonn't let me execute the program, it interrupts it...
Am I allocating memory incorrectly or something?
I really don't know what could be wrong...
//Initializing the class
void stuff::init()
{
*what=0;
how_many=0;
price=0;
got=0;
}
// Putting user-defined variables in the class
void stuff::define()
{
char *str;
int n;
double p;
char* g;
cout<<"\n Insert item name: ";
cin>>gets(str); put_what(str);
cout<<"\n Insert number of items needed: ";
cin>>n; put_how_many(n);
cout<<"\n Insert price of item: $";
cin>>p; put_price(p);
cout<<"\n Has the item already been bought? ";
cin>>gets(g);
if(strcmp(g,"Yes")) got=0;
else got=1;
}
// Displaying the contents of the class on the screen
void stuff::display()
{
cout<<"\n Item: "<<get_what();
cout<<"\n Number of items needed: "<<get_how_many();
cout<<"\n Price of item: $"<<get_price();
cout<<"\n Has the item already been bought?"<<gots();
}