Can someone help me with this problem

Create a header file called Bag.h that contains following class template:

Template<class ItemType>
Class Bag
{
Public:
Bag();
bool add (ItemTypy item);
ItemType max ();
int find (ItemType item);
void display ();
Private:
ItemType myArray[100];
int size;
};
]
1) Open notepad.
2) select File->new
3) copy + paste code into notepad document.
4) select File->save as
5) Enter bag.h as the file name
6) click "save"

Thanks to fun2code.

PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Public:
change to public:
Private:
change to private:
bool add (ItemTypy item);
I think there's a typo, ItemType(ItemTypy).
C++ is a case-sensitive language.

So you basically must create a .h file called Bag(file name-extension), and paste the code in it BINGO!!! Even notepad.exe can be used for this.

Aceix.
Topic archived. No new replies allowed.