Hey, slow down tenderfoot. You seem to be moving so fast you're stumbling over your own feet.
Inclusion guards are great. I'm glad you know about them. However, they should go at the top of the file so you don't include std or fstream or other files multiple times if you are linking/including multiple files , in your program.
Syntax such as,
const int MAX = 50;
is preferred to
define int MAX 50;
It would also be preferrable for MAX to have some scope other than global, so I'd declare it is main() rather than before it. As posted, MAX has no value whatsoever, as the line declaring MAX is commented out.
I would tend to name the class Shoe rather than Shoes. That way I can use Shoes as the name of a container (in this case an array) of multiple instances of type Shoe. I like to have each type be able to display an instance of itself. I would use functions outside the type declare to accumulate a group of instances of the type and to display any, or all, of the instances belonging to that group of instances.
The file you are using has a value indicating how many instances of type Shoe are in the file. You should use the variable length, instead of literal int 6, when dealing with actual number of instances of type Shoe are actually in the array, for example in the loop used to load array when reading from the file.
Syntax such as,
const int MAX = 50;
is preferred to
define int MAX 50;
It would also be preferrable for MAX to have some scope other than global, so I'd declare it in main() rather than before it.
As posted, MAX has no value whatsoever, as the line declaring MAX is commented out.
The pointer parameter you are using refers to an array of type, not to a single instance of type. Typically, you would also send the size of the array and the actual number of elements in the array.
const int MAX = 50;
T t[MAX]; //declare an array of type T holding, at most, MAX number of instances of type T
int len = 6; //assume there are only 6 instances of type T in t.
void view(T* t, int len); //declaration of a function, outside of the class and global in scope, that displays an array of type T called t which has len instances of type T in it.
Here is an alternate syntax to declare a function called view to display the elements of type T contained in an array of type T called t that could hold MAX elements but actually has only len elements in it at this time.
void view(T t[MAX], int len);
The pointer verssion to decare view() is quicker to type, and would be preferred if t were declared using dynamic memory. The alternate version of view() is explicit in indicating that t is an array of type T, not a pointer to single instance, and that t could hold up to MAX elements, but actually only has len.