#include "outpu.h"
#include <time.h>
#include <string>
#include <iostream>
#include <conio.h>
usingnamespace std;
void textout(string text)
{
srand(time(NULL));
long lengte = text.size();
float cntr;
int randomget;
clock_t btime;
clock_t t;
bool br=false;
for (int b=0; b < lengte; b++)
{
randomget = 100 - (rand() % 50);
cout << text.substr(b, 1);
cntr = randomget / 10000.0;
btime = clock();
t = clock()-btime;
while ((t) / CLOCKS_PER_SEC < cntr)
{
if (_kbhit())
br = true;
t = clock() - btime;
if (br)
break;
}
if (br)
{
cout << text.substr(b + 1, (lengte - (b + 1)));
break;
}
}
}
and I think it should work, but it takes way too long in between letters...
any help?
also I wonder if it's possible to get the program to notice the key hit, but not save that data to cin