DevarajA wrote on 03/09/05 :
Is it possible to write a function that, once called, is executed together
with the caller without stopping it? I've seen such functions in windows
programming, using CALLBACK qualifier before the function name (is it a
macro?). Now I would like to know if this could be possible in standard C,
maybe using some tricks. And going a little ot.. what other non-standard ways
to do that do you know?
Callbacks have nothing to do with concurrent ('executed together ')
functions. They are just user functions called by some lower level
function (system, library...) See the standard qsort() function and its
'compare' callback.
If you want concurrent (well, sort of) execution, you want processes or
threads. Theses are beyond the scope of the C-language. Ask a newsgroup
dedicated to your system.
--
Emmanuel
The C-FAQ:
http://www.eskimo.com/~scs/C-faq/faq.html
The C-library:
http://www.dinkumware.com/refxc.html
"Clearly your code does not meet the original spec."
"You are sentenced to 30 lashes with a wet noodle."
-- Jerry Coffin in a.l.c.c++