I was wondering if there was a way to "freeze" an input line in order to separate input and output from each other in c. For instance, my console output is currently something like this:
1 OutputLine1
2 OutputLine2
But I'd like it to be something like this:
1 OutputLine1
2 OutputLine2
3 Enter a Command:
and I'd like for it to be able to change as the program receives a stream of data. So as it runs it would be something like this
1 OutputLine1
2 OutputLine2
3 OutputLine3
4 Enter a Command:
To change to this:
1 OutputLine1
2 OutputLine2
3 OutputLine3
4 OutputLine4
5 Enter a Command:
I'm currently using printf() for all my output, but it doesn't seem like that would work in this situation. Are there any other printing/input libraries I can use?
Thanks in advance!!