This should work, no casting required:
void f(int x) { printf("%d\n", x); } int main(int argc, const char ** argv) { typedef void (*int_void)(int); int_void test = f; ... }
The name of the function "goes" to the function pointer at any time when you use the name of the function in something other than a function call. If is is assigned to func ptr of the same type, you don't need a listing.
Original
typedef int_void(int);
not useful on its own without using a type pointer. Therefore, the answer to your question is βno, you cannot use this typedef without a pointerβ.
source share