ok say heres my code in once source file..
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;
}
what would i put in the header file.. the menu and period functions use the class..
this is my header file
Code:
#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
i included my header file and when i try to compile main.cpp
Code:
#include <sstream>
#include <fstream>
#include <iostream>
#include <string>
#include "bank.h"
int main()
{
menu(); // calls menu function
system("PAUSE");
return 0;
}
it gives me this error 18 K:\...\bank.h `string' does not name a type
also how would i do a makefile?