-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitem.h
45 lines (36 loc) · 1.1 KB
/
item.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// item.h
// Michael Bottini
// Created for CS260
// June 22, 2014
// Header file for "item" class, which will be used in an inventory
// manager.
#ifndef ITEM_H
#define ITEM_H
#include <cstring>
#include <iostream>
class item {
private:
char* _name;
double _weight;
public:
item(const char* newName = "", double newWeight = 0);
item(const item& originalItem);
item& operator =(const item& originalItem);
~item();
char* getName() const;
double getWeight() const;
void setName(const char* newName);
void setWeight(double newWeight);
void printSuccess() const;
void printFailure() const;
bool operator <(const item& other) const;
bool operator >(const item& other) const;
bool operator ==(const item& other) const;
bool operator !=(const item& other) const;
bool operator <=(const item& other) const;
bool operator >=(const item& other) const;
};
int CIstrcmp(const char* str1, const char* str2);
void toLower(char* str);
char* makeAndCopy(const char* newName);
#endif