clocksimulator/Project1/Main.h
2023-03-17 17:36:07 -07:00

31 lines
536 B
C++

/*
* Clock app for Project One
* Main.h header file
*
* Date: 2022/03/16
* Author: Cody Cook
*/
#pragma once
#include <iostream>
using namespace std;
void clearScreen()
{
// Clear the screen
system("CLS");
}
void clearCin()
{
/* When the cin potentially contains bad data;
* like alphabeticals when looking for unsigned integers.
* Doubles as a pause function, surprisingly, if necessary.
*/
// clear the cin and also ignore the rest of the line
cin.clear();
cin.ignore(numeric_limits<streamsize>::max(), '\n');
}