QUOTE
The .h with the cpp folder and then the main.cpp folder.
They are actually files.
1)Functions.cpp - you can name this whatever but usually contains functions and classes
2)Functions.h - usually the same name as your .cpp(where functions and classes are declared)
3)Main.cpp - your main program
So you can setup your project as so
1)Functions.cpp
CODE
//An example of declaring a function in your function.cpp file.
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
bool ReadFile(vector <string> &vec)
{
string temp;
ifstream rdFile;
rdFile.open(FILE_IN);
if (!rdFile)
{
cout << "Error! Cannot find file" << endl;
return false;
}
while( getline( rdFile, temp ) )
vec.push_back(temp);
return true;
}
2)Functions.h
CODE
//The prototype for your readFile function
bool ReadFile(vector<string> &vec);
3)Main.cpp
CODE
//Your main program is executed
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include "Functions.h" //INCLUDE HEADER FILE HERE SO FUNCTIONS WILL
//BE AVAILABLE TO THE REST OF THE PROGRAM
int main()
{
bool fileFound = true;
vector <string> vec1;
fileFound = ReadFile(vec1);
}
Hopefully this helps.