I just want to release or destroy the contents of string[] and reset it back to its original state so my if statements will prove false.
int main()
{
int random_number;
float count = GetTickCount();
char string[7];
bool end = false;
while(end != true)
{
srand(GetTickCount());
random_number = rand()%20 + 1;
printf("\nType \"roll\" and hit <ENTER> to roll a");
printf(" random number, or to quit.\n\n");
fgets(string, 7, stdin);
if(strlen(string) > 5)
{
_flushall();
//(release contents of string[])
printf("true");
}
if(strnicmp(string, "exit", 4)==NULL)
{
printf("\nExiting...\n\n");
end = true;
_flushall();
exit(0);
}
if(strnicmp(string, "roll", 4)==NULL)
{
printf("\n%.0f\n\n", count);
printf("%i\n", random_number);
}
}
return 0;
}
-- Well I solved it by using a bool value and a conditional && statement, but I'd still like to know how to destroy a character array. --