• 0

ctrl+c


Question

anyone have a general/rough idea on what would prevent ctrl+c from working correctly? (i have to hold it for a while before the application will terminate) i'm just curious on what could actually cause ctrl+break to break since it works everywhere including infinite loops :p

cheers

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0
Is this a command line program or does it have a GUI? More details would help (language, environment, etc.)

command line, c++, linux (ubuntu)

i've resolved the problem i was having (was trying to close an unused socket)

I was just curious as to why ctrl+break would ever have any issues stopping a program i've experienced it a few times and wondering how a bug could affect it being terminated (having to be called multiple times)

Link to comment
Share on other sites

  • 0

^C is a control sequence that interrupts the execution of an active program/command.

The process receives a interruption signal (SIGINT), and if there's nothing defined in the program on how to deal with this signal, it gets interrupted.

I never heard of ^Break.

Edited by tiagosilva29
Link to comment
Share on other sites

  • 0
^C is a control sequence that interrupts the execution of an active program/command.

The process receives a interruption signal (SIGINT), and if there's nothing defined in the program on how to deal with this signal, it gets interrupted.

I never heard of ^Break.

I'm pretty sure Ctrl+Break is the key combination for halting a task that's running in MS-DOS.

yeah sorry ment ctrl+c (typed in first post second one was a typo) i just refer to ctrl+c as break since thats what its basically doing

thanks for the explanation tiagosilva i get thats its ment to do that but would could possibly prevent that from happening if no such definition exists? unless its implemented by sockets on a bad close

Link to comment
Share on other sites

  • 0
yeah sorry ment ctrl+c (typed in first post second one was a typo) i just refer to ctrl+c as break since thats what its basically doing

thanks for the explanation tiagosilva i get thats its ment to do that but would could possibly prevent that from happening if no such definition exists? unless its implemented by sockets on a bad close

If I'm recall properly... you can define how your program deals with signals via the signal() function in the include signal.h, which exists in both C and C++.

In Bash you use the trap command.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.