tags:

views:

109

answers:

5

Maybe I use inline functions...
There are any way to archieve it, without using function pointers?

Thanks in advance.

+3  A: 

Not in C. You can in C++.

Hans Passant
+3  A: 

Not in C. But you can in C++.

Amardeep
+3  A: 

No, structure supports only a pointer to a function.

pcent
+1  A: 

No

The only way I can think of is similar to this one (with function pointers).

Iulian Şerbănoiu
A: 

to complement all other answers, i would add that a, in C, a structure is only for storing data: a function is not data, so it cannot be stored into a structure.

however, as pcent pointed out, a pointer to a function is a type of data and can be stored in a structure.

Adrien Plisson