Horje
linux c++ sigint handler Code Example
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\n");
        abort();
    }
}

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




Cpp

Related
operator overload Code Example operator overload Code Example
136. Single Number leetcode solution in c++ Code Example 136. Single Number leetcode solution in c++ Code Example
c++ method name Code Example c++ method name Code Example
escribir texto c++ Code Example escribir texto c++ Code Example
c++ typedef template class Code Example c++ typedef template class Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7