Is it possible to wait for the user to input an specific value to do something, and if it does'nt do it in a certain amount of time it makes another thing instead?
I know it's possible to run 2 functions at the same time or run functions in the background with threading, but as it's very advanced for me at this moment I would like a more practical way to do it. If you want to hive me a header file or a library it's ok.
Not with standard stream facilities. They're just not designed to do this. Throwing threads at the problem does nothing.
With the console, you'd have to acknowledge that the program is running on one and deal with it directly. There's several ways to do it. The curses libraries are cross-platform, and Windows provides an interface to the console.
With GUIs, this is easier. You just create a timer that triggers an event. If by the time you handle the event the user hasn't finished, you just do whatever it is you want to do in case of a timeout.
Well, yeah, I'm pretty sure all "console application" determines is the point of entry (main() vs. WinMain()). You can even create windows and handle messages.
I don't see what this has to do with anything, though.
helios was referring to using an OS or third party library or toolkit. It doesn't necessarily have to be a GUI environment, but it will have extra features that aren't supported by the C++ standard. Typically, third party libraries deal with GUIs and/or Game Development and have a specific way to handle keyboard/mouse events such as typing a letter, moving the mouse, and some even have support for joysticks.
To incorporate this into your program, you have the option to use something like a timer as helios had suggested, which can trigger an event. There are also ways to using the Windows libraries to do something similar but typically takes a little more knowledge of the windows libraries before being able to do it.
The timer can be created using the basic <time> library in C++, can be wrapped in a loop to check to make sure the time hasn't elapsed, and within the loop, you can check to see if anything was typed on the keyboard. This is a way to do it, albeit, not proper. C++ wasn't specifically designed around using any specific kind of input devices so the options are limited. This is where the third party libraries come into handy. If you ever heard of the conio.h header file, this was an attempt to bring some of those functionalities to C++, but it couldn't be standardized so it has faded away.
If you only plan on doing this once, I'd suggest trying to think of a different way to do what you want. If you plan on using keyboard input much more often (similar to playing games, etc.) then look into some of the libraries. I know SDL, SFML, and GL all support external input devices, but so do almost every single toolkit.