A very SIMPLE program that is IMPOSSIBLE to create on Mac!
Hello everyone! This is my first post so thanks for the community for letting me in and hope everybody is in great shape. I am an "amateur" programmer who only knows the C language, pretty much used to it.
Well, maybe the "IMPOSSIBLE" in the title is a little hyperbolic, who knows, but I've spent literally almost 3 days searching to do a very basic program and I can't find out how!
I am looking to make a program that starts counting the time when pressing the space button, then stops counting the time when the space button is pressed again, using clock() (for very precise time). Or in other words, how to make C calculate the time spent between pressing space button 2 times. That's it.
On Mac, there is no library such as <conio.h>, we have <curses.h>, but does not have all functionalities.
Main difficulties:
1-I don't know how to make C understand that I want it to take into account a button I pressed without requiring ENTER.
2- I found out Scanf pauses the clock(), so while waiting for the user the time is not calculated..... I must find a way for a program to be paused while calculating time simoultaneously.
I hope my message was simple and clear.
Thanks for anyone who has knowledge for help!