Tagged Questions
0
votes
1answer
39 views
Still not getting callback vs normal function call
I have seen almost all popular question of callback here, but still not getting why use function pointer in callback instead of simply used callback via normal function. Here's the accepted answer ...
0
votes
2answers
49 views
Callback function misunderstanding
Here's the question that asked:
What is a “callback” in C and how are they implemented?
and one of the answer in that question is like this:
(I slightly modified to print the value also)
#include ...
1
vote
2answers
38 views
ansi c globally accessible callback
I'm trying to setup a globally accessible callback function within a c program using a method supplied during runtime.
So far I've got the following:
principal.h
-----------
extern Callback ...
52
votes
5answers
53k views
Callback functions in c++
In c++, when and how do you use a callback function?
EDIT:
I would like to see a simple example to write a callback function.
0
votes
2answers
148 views
using c++ class member function with C function pointer
I am using a C library that implements a command shell. Custom shell commands are registered by implementing a function with the following call signature:
typedef void(* ...
1
vote
4answers
103 views
Why use a callback instead of a normal function call?
I'm trying to understand callbacks, and do get the idea, but do not understand why it is really needed.
Specifically, what added benefit does it provide over a normal function call? I'm looking at ...
0
votes
1answer
62 views
Clarification on concept of callbacks and function pointers in c
I found this line on wikipedia about function callbacks,
"In computer programming, a callback is a reference to executable code, or a piece of executable code, that is passed as an argument to other ...
3
votes
2answers
287 views
Advantage of function pointers over flags [closed]
Lets say for eg., I have a function called int compute ( int x1, int x2, int (* op) (int, int) ), which takes as an argument a function pointer to a function that does some arithmetic operation
int ...
6
votes
3answers
143 views
Is it safe to pass an intptr_t to a function that expects an int?
More specifically, if I have the following function pointer type:
typedef void (*callback_type) (intptr_t context, void* buffer, size_t count);
can I safely and without "undefined behavior" do:
...
1
vote
1answer
35 views
set_format callback in gstreamer
Can anybody explain me something about set_format() callback in gstreamer?
Will this function invoked if any of the pad properties changes? Will this callback happens after each frame processing? ...
2
votes
4answers
1k views
c++ Implementing Timed Callback function
I want to implement some system in c++ so that I can call a function and ask for another function to be called in X milliseconds. Something like this:
callfunctiontimed(25, funcName);
25 being the ...
62
votes
9answers
61k views
Callback functions in Java
Is there a way to pass a call back function in a Java method?
The behavior I'm trying to mimic is a .Net Delegate being passed to a function.
I've seen people suggesting creating a separate object ...
1
vote
1answer
37 views
Give selector.method as parameter, call it
I've got a function $.doSomething() which does some stuff and then should call other functions in the jQuery-form of $('selector').function(). I do not want $.doSomething() to know about what it's ...
5
votes
4answers
381 views
C++ How to Reference Templated Functions using std::bind / std::function
If you have a templated class or a templated function, (or combination of the two), how do you bind that function, (preserving the template type parameter)?
I was given some help about the basic ...
0
votes
0answers
131 views
How to use call backs in C++ like delegates in C#? [duplicate]
Possible Duplicate:
What is a C++ delegate?
I need to use a callback in C++ like delegates in C#. For example, in C# we have:
...
public delegate void SomeWorkhandeler(object Arg);
...
...