Notes for Dec 7

hello.h

// hello.h
// Header files should ONLY contain
// declarations (prototypes) and
// constants, but not variables.

void say_greeting(string name);

greeting.cpp

#include <iostream>
using namespace std;
#include "hello.h"

void say_greeting(string name)
{
    cout << "Hello " << name << endl;
}

main.cpp

#include <iostream>
using namespace std;
#include "hello.h"

int main()
{
    say_greeting("Chris");
    return 0;
}