hi
im tryin to read some info (both characters and integers) from an input file and save them into the sorted list. it is a big project and i cant put all the files i have over here. so i'll just put the part im having a problem.
i have a class named NutritionFacts, which is this :
/*
typedef int Type1;
using namespace std;
#ifndef NUTRITIONFACTS_H
#define NUTRITIONFACTS_H
class NutritionFacts
{
public:
NutritionFacts();
NutritionFacts(char *name);
Type1 getNutritionFacts();
void setNutritionFacts(Type1 calories, Type1 fat, Type1 carbohydrates);
void display();
void read(ifstream & inFile);
private:
char _name [70];
Type1 _calories;
Type1 _fat;
Type1 _carbohydrates;
};
#endif
*/
and i have other classes of Node, List and SortedList. i set the data type into NutritionFacts like this : for example in the Node class
/*
#ifndef _NODE_H_
#define _NODE_H_
typedef NutritionFacts Type;
class Node {
public:
Node(Type x, Node *n = 0);
Type getInfo();
Node *getNext();
void setInfo(Type x);
void setNext(Node *n);
private:
Type info;
Node *next;
};
#endif
*/
its giving me the errors only on that "typedef NutritionFacts Type;" so far..
what am i doing wrong? thanks in advance.