< Previous | Contents | Next >
As usual, I start with some comments and include the files I need.
// Hangman
// The classic game of hangman
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <ctime> #include <cctype>
using namespace std;
Notice that I include a new file—cctype. It’s part of the standard library and it includes functions for converting characters to uppercase, which I use so I can compare apples to apples (uppercase to uppercase) when I compare individual characters.