Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <stdio.h>
#include <stdlib.h>
#include "tools.h"
/**********************************************************/
/**********************************************************/
void clearScreen()
{
system("clear"); // Linux
// system("CLS"); // Windows
}
/**********************************************************/
/**********************************************************/
void clearBuffer()
{
char Dummy;
do
{
scanf("%c", &Dummy);
} while (Dummy != '\n');
}
/**********************************************************/
/**********************************************************/
void waitForEnter()
{
printf("\nBitte Eingabetaste druecken ...");
clearBuffer();
}
/**********************************************************/
/**********************************************************/
int askYesOrNo(char *Question)
{
char Input;
do
{
printf("%s", Question);
scanf("%c", &Input);
if (Input != '\n')
clearBuffer();
} while ((Input != 'j') && (Input != 'J') && (Input != 'n') && (Input != 'N'));
return ((Input == 'j') || (Input == 'J'));
}