interrupt command

0 Franz Schmidt · May 7, 2015
i know that commands like gets or getline or cin and all these input functions wait till the user made his/her input and then continues with the programm.
Is there a way to only wait for lets say 10s or something like that and if nothing gets entered the programm continues by it selft?

Post a Reply

Replies

Oldest  Newest  Rating
0 c student · May 7, 2015
EDIT: Just realised this won't work
0 Franz Schmidt · May 7, 2015
is there also a solution for microcontrollers where windows.h is not available?
0 Michael Bradford · May 7, 2015
The way to do something like this when windows.h is not available is to use Chrono from stdlib.
http://en.cppreference.com/w/cpp/chrono/duration.
0 Franz Schmidt · May 7, 2015
sry my bad i did post this topic under c++ but it belongs just to c.
is it also possible to do it with plain c methods or a library for multithreading or something like this.
0 c student · May 7, 2015
http://man7.org/linux/man-pages/man2/fork.2.html
  • 1

C++

106,982 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator