Name: Anonymous 2005-07-25 21:25
Im using it in a class of mine...and I have crashed it 4 times in the past 3 hours....in programs that go to the extent of this
(In this programs case it crashed while building because I forgot a }....so sad...)
#include<iostream.h>
class Item
{
int number;
float cost;
public:
void getData(int a, float b);
void putData(void);
};
void Item :: getData(int a1, float b1)
{
number = a1;
cost = b1;
}
void Item ::putData()
{
cout<<"number: "<<number<<endl;
cout<<"Cost: "<<cost<<endl;
}
int main()
{
Item Item1, Item2, Item3;
Item1.getData(20, 200);
Item2.getData(13, 120);
Item3 = Item2;
Item1.putData();
Item2.putData();
Item3.putData();
return 0;
}
(In this programs case it crashed while building because I forgot a }....so sad...)
#include<iostream.h>
class Item
{
int number;
float cost;
public:
void getData(int a, float b);
void putData(void);
};
void Item :: getData(int a1, float b1)
{
number = a1;
cost = b1;
}
void Item ::putData()
{
cout<<"number: "<<number<<endl;
cout<<"Cost: "<<cost<<endl;
}
int main()
{
Item Item1, Item2, Item3;
Item1.getData(20, 200);
Item2.getData(13, 120);
Item3 = Item2;
Item1.putData();
Item2.putData();
Item3.putData();
return 0;
}