I have a programme that when the command (cin) help is entered it brings up a help note. That note looks somewhat like this:
C++
if (cmd == "help")
{
cout << "▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄\n";
cout << "██ Help Menu ██\n";
cout << "▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n";
cout << "Press a key then enter to continue\n" << string( 10, '\n' );
cin.ignore();
return 0;
}
the string var cmd being 'help'.
I am compiling this on a mac and have included:
C++
#include <iostream>
#include <string>
using namespace std;
What code can i use to make this work? cin.ignore();
doesn't seam to do anything and nether does cin.get();