S
S
sddvxd2018-12-11 00:01:50
C++ / C#
sddvxd, 2018-12-11 00:01:50

Why is there no pointer in the second case?

Good afternoon!
I don’t understand much why compilation is allowed in the second case:

typedef int (*SIG_TYP)(int); 
typedef void (SIG_ARG_TYP)(int);
SIG_TYP signal1(int, SIG_ARG_TYP){};

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2018-12-11
@sddvxd

typedef int (*SIG_TYP)(int); 
typedef void (SIG_ARG_TYP)(int);
SIG_TYP signal1(int, SIG_ARG_TYP){};

how to understand the second construction? is it a pointer?

No, this type is the type of a function (not a pointer to a function).
Those. can be written like this:
and this will be the declaration of the function foo.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question