Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C only
Search
Advanced Search
Forums
Product Launch
Updates
Today's Posts
Member List
Calendar
Home
Forum
Topic
C
unable to understand this typedef
Collapse
This topic is closed.
X
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
Sanchit
#1
unable to understand this typedef
Mar 20 '08, 02:25 PM
What does this typedef represent?
typedef void Sigfunc(int);
-Sanchit
Eric Sosman
#2
Mar 20 '08, 02:45 PM
Re: unable to understand this typedef
Sanchit wrote:
What does this typedef represent?
typedef void Sigfunc(int);
It declares Sigfunc as an alias for "function of one
int argument returning no value."
You can't actually use Sigfunc to define a function:
Sigfunc func ... er, where's my parameter list?
{
... er, how do I refer to the parameters?
... er, what do I return? it looks like I
should return a function, but ...?
}
However, you *can* use it to declare a function:
Sigfunc sig1; /* sig1 is a function ... */
Sigfunc sig2; /* sig2 is a function ... */
And you can use it to describe a function pointer:
Sigfunc *fptr = sig1;
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment