Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can someone explain the difference between these two typedefs? (Function pointer related)

This one is quite obviously a function pointer :

typedef int (* foobar) (int a, unsigned char *b, unsigned int c);

But what does this one do?

typedef int (foobar *) (int a, unsigned char *b, unsigned int c);
like image 829
Quicksilver Avatar asked Dec 17 '22 02:12

Quicksilver


1 Answers

It produces a compiler error, at least in GCC 4.3:

foo.cpp:1: error: expected `)' before '*' token
like image 137
Brooks Moses Avatar answered Dec 28 '22 22:12

Brooks Moses