a pointer to a function, which can be stored in a variable allows a run-time choice of which function to run

learn more… | top users | synonyms (1)

1
vote
4answers
33 views

Stuck on a thread issue

So I have this void* tf(void* p); which I dont totally understand. What I think it is, is a function pointer with a void pointer for a parameter. I am using it to make a thread like this: ...
0
votes
2answers
18 views

Personnal implementation of Java events in Slick2D

I'm making my own windowing system in Java with Slick2D right now and I want to add buttons to my windows! The thing is that I have no knowledge on events or such things... Everywhere I look it's ...
0
votes
1answer
60 views

C++11 - What is wrong with this use of decltype function pointer?

While trying to implement a Delegate-class using variadic templates I ran into a problem I'm unable to solve: /// -------------------------------------- /// @thanks God /// Steve ...
0
votes
0answers
35 views

Cuda function pointer consistency

I recently tried to use function pointer to dynamically define several processing stage in my application, running on a sm_30. It would be difficult to post the code here, as there are many ...
0
votes
2answers
36 views

Compile errors in a test program with function pointers

I've written a simple C program to learn usage of function pointers: #include <stdio.h> int (*workA) ( char *vA ); int (*workB) ( char *vB ); int main( int argc, char * argv[] ) { char ...
3
votes
1answer
131 views

Pointer to variadic function template

I have a simple class A, providing a variadic function template. This function uses private data from within A, but the function itself is public. The class goes as follows: class A { public: ...
0
votes
2answers
16 views

Overriding versus function pointers

Why do programmers prefer overriding to using function pointer fields? Performance benefits? - Not that I know of. Is it code readability? - No, the syntax is pretty much the same. The only ...
0
votes
1answer
32 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 ...
0
votes
1answer
46 views

For a function pointer func_ptr,(*func_ptr)() invokes the function.But why are (****func_ptr)() or (***func_ptr)() valid?

Suppose func_ptr is a function pointer to the function test().Then we know that can invoke the function test() using this pointer as (*func_ptr)(); But I was told today that even ...
0
votes
3answers
38 views

Changing stdout (putch() function) on the fly in C

I'm using the XC8 compiler. For that, you have to define your own void putch(char data) function in order for functions like printf() to work, as is described here. Basically, putch() is the function ...
0
votes
2answers
55 views

Why can we use function pointers both as (*func_ptr)() and func_ptr() to invoke a function,but not so for array pointers?

Suppose we have a function pointer func_ptr of type void (*func_ptr)().Then we know that using this we can invoke the function using this pointer both as : (*func_ptr)(); func_ptr(); But ...
0
votes
3answers
37 views

What do we have in the bytes beginning at the “Address of a function”?How to know how many bytes to consider?

My brain gets numb just even imagining this.So bear with me if my question is little wordy.So I've sliced my question into parts. 1) What do we have at the at the bits/bytes starting at the address ...
0
votes
1answer
46 views

Getting an error: no match for operator[] in [closed]

As stated above I'm getting a error:no match for operator[] in mHbbtSMFnPtrs[mCurrHbbtvState][hbbtvSMEvntsParam](hbbtvSMEvents, hbbtvSMEvntsParam); typedef int (*HBBTVSMFnPtr)(int hbbtvSMEvent, ...
4
votes
5answers
103 views

What is (void (**) ()) and how to typedef it?

In an embedded code I have to understand, there's this line of code : *((void (**) ()) 0x01) = c_int01; /* Write the interrupt routine entry */ I can grasp the fact that you setup the interruption ...
0
votes
1answer
52 views

Array of function pointer pointers

If I want an array of pointers to something, I declare it like this: Type** var = new Type*[8]; and use it like this: if(var[0] != NULL) // Do something But how can I have an array of ...

1 2 3 4 5 84
15 30 50 per page