Structure of a Program

Here is a short read to refresh on how to best structure a C++ program.

Structure of a program – C++ Tutorials

The best way to learn a programming language is by writing programs. Typically, the first program beginners write is a program called “Hello World”, which simply prints “Hello World” to your computer screen. Although it is very simple, it contains all the fundamental components C++ programs have:

Reading a File with C++

Here is just a simple example of reading a file with iostream. Just follow my comments to understand.

Good luck, sometimes newlines and spaces can mess you up, you may need to utilize an ignore() or something else.

#include <fstream>
#include <iostream> 
using namespace std;

void evaluateFile(string ins); //Do something with the file contents
void readFile(); //Read the file

int main(){
    return EXIT_SUCCESS;

void readFile(){
    ifstream input;
    string fileName;
    cout << "What is the full path of file to be read" << endl;
    getline(cin, fileName); //Prompt user for filename, needs to be the fill path; //Open thhe file
    if ({ //Fail case
        cout << "Sorry, cannot open file. Quitting now." << endl;
    while(!input.eof()){ //Read file until the end of file is reached
        string line;
        getline(input, line);

void evaluateFile(string line){
    cout << line << endl;