I looked it up and attempted to implement it but i still had no output. Only way i got output was at the end of the program all at once. Here is the code ive added. I've commented out the things ive tried but didnt work.
Code:
tcsetattr(1, TCSANOW, &newTerm);
//create buffer for int to char conversion
//char numToWord[25];
setvbuf(stdout, (char *)NULL, _IONBF, 0);
for(; startNum > 0; startNum--)
{
//sprintf(numToWord, "%d", startNum);
printf("%d", startNum);
//fflush(stdout);
sleep(1);
}
}
tcsetattr(1,TCSAFLUSH,&oldTerm);
return 0;
Its possible my implementation is wrong. If so please do let me know how to fix it. The above code starts just above the for loop in my original post code.
***EDIT***
Managed to solve the program