Please, would you help me? I don`t know why this program doesn`t run.
Code:
#include <iostream>
#include <string>;
using namespace std;
class Item
{
public:
Item ()
int getPower() const;
int getWeight() const;
int getName() const;
void setPower();
void setWeight();
void setName();
void read();
void print() const;
private:
int power;
int weight;
char name[256];
};
void Item::read()
{
cout << "Power: ";
cin >> power;
cout << "Weight: ";
cin >> weight;
cout << "Name: ";
for (int i=0; i < 256; i++)
cin >> name[i];
}
void Item::print()
{
cout << "Power: " << power << endl;
cout << "Weight: " << weight << endl;
cout << "Name: " << name << endl;
void main ()
{
Item Item1;
Item1.setPower(63);
Item1.setWeight(86);
Item1.setName(23);
cout << Item1.getPower() << endl;
cout << Item1.getWeight() << endl;
cout << Item1.getName() << endl;
system("PAUSE");
}