1

How is event driven programming implemented? Is it just a while loop which checks for all activated / needed / possible events?

while( user did not exit )
{
   if ( bla bla happened )
     start function //event

  //same crap for another event
  ...

} 

This seems really wrong to me. An event driven program shouldn't do anything until the event has been activated, right? This would just loop and loop.. probably the cpu would go higher and higher.

I couldn't find any implementation code on the internet.

Davlog
  • 2,162
  • 8
  • 36
  • 60
  • 1
    For C#, look here: http://stackoverflow.com/questions/213638/how-do-c-sharp-events-work-behind-the-scenes. Basically, an event handler is a container for a method reference. When the event fires, the method that has been plugged into the event handler is called to handle the event. An event is a form of indirection, in other words. – Robert Harvey May 31 '13 at 21:01

0 Answers0