ok say heres my code in once source file..
what would i put in the header file.. the menu and period functions use the class..Code:#include <sstream> #include <fstream> #include <iostream> #include <string> #include "stdlib.h" #define SIZE 50 // size of the array using namespace std; class store // defines a class with variables { public: int custnum; string product; int quantity; string month; string day; string year; int tmpcustnum; int tmpquantity; string tmpmonth; string tmpday; string tmpyear; bool isfirsttime; }; store STORE1[SIZE]; // creates a class void menu() { . . } void period(int num_line, string productname, string month1, string day1, string year1, string month2, string day2, string year2) { . . } int main() { menu(); // calls menu function system("PAUSE"); return 0; }
this is my header file
i included my header file and when i try to compile main.cppCode:#ifndef BANK_H #define BANK_H #define SIZE 50 class store // defines a class with variables { public: int custnum; string product; int quantity; string month; string day; string year; int tmpcustnum; int tmpquantity; string tmpmonth; string tmpday; string tmpyear; bool isfirsttime; }; store STORE1[SIZE]; // creates a class void menu(); #endif
it gives me this error 18 K:\...\bank.h `string' does not name a typeCode:#include <sstream> #include <fstream> #include <iostream> #include <string> #include "bank.h" int main() { menu(); // calls menu function system("PAUSE"); return 0; }
also how would i do a makefile?



LinkBack URL
About LinkBacks


