Search
 
SCRIPT & CODE EXAMPLE
 

CPP

linux c++ sigint handler

#include <signal.h>
#include <iostream>
#include <thread>
#include <chrono>

void sigint_handler(int signo) {
    if (signo == SIGINT) {
        printf("received SIGINT, aborting abruptly
");
        abort();
    }
}

int main() {
    signal(SIGINT, sigint_handler);
    while (true) {
        std::cout << "Loop..." << std::endl;
        std::this_thread::sleep_for(std::chrono::milliseconds(500));
    }
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: C++ Calculating the Mode of a Sorted Array 
Cpp :: put text on oled 
Cpp :: sfml keyboard events cpp 
Cpp :: print hola mundo 
Cpp :: c++ std string to float 
Cpp :: set of vectors c++ 
Cpp :: bfs sudocode 
Cpp :: one dimensiol array to two dimen c++ 
Cpp :: loop execution descending order in c++ 
Cpp :: Initialize Vector Iterator 
Cpp :: how to reset linerenderer unity 
Cpp :: cmd color text c++ 
Cpp :: vector::at() || Finding element with given position using vector in C++ 
Cpp :: c++ garbage collection 
Cpp :: find maximum sum in array of contiguous subarrays 
Cpp :: Character cin(userInput) in c++ 
Cpp :: cyclically rotate an array by once 
Cpp :: STD::ERASE FUNCTION IN C++ 
Cpp :: c++ write string 
Cpp :: C++, binary search recursive 
Cpp :: priority queue in cpp 
Cpp :: hashset in cpp 
Cpp :: c++ vector operations 
Cpp :: error in c++ 
Cpp :: . The cout with the insertion operator (<<) is used to print a statement 
Cpp :: c++ include difference between quotes and brackets 
Cpp :: 41.00 
Cpp :: print all variables separated by comma c++ 
Cpp :: c++ camera capture 
Cpp :: true false operator 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =