About the C language declaration void (*signal (int sig, Void (*FUNC) (int))) (int) is understood

Source: Internet
Author: User

I just started seeing this, it hurts.

Or do you understand it slowly?

First of all

void (*FUNC) (int) is a pointer to a function with a return value of void parameter int

is a function pointer

Specific Understanding Http://zhidao.baidu.com/link?url=5GpEN7wPUhDlk_m-3drRHV9bGxv53tj818vtd1GIsyaVfyY1mdsFZfP6_2M_DNAfTQrh0qxMo _wxhk1cjiepjk

And see if the perimeter function declaration is a little bit like inside.

The inside function of the pair is abbreviated void (*signal (XXX)) (int)
The same as the function declaration inside is a no return value there is an int parameter that returns a function pointer to the type of the function shown above

Reference

Middle part:
Signal (int sig, Void (*FUNC) (int))
The signal function has 2 parameters, the first is int, the second is no return value, and a function pointer with an int argument

Peripheral:
void (*signal (XXX)) (int)
The signal function returns a function pointer with no return value and an int parameter

Simplified:
typedef void Sigfunc (int)
Sigfunc represents a return value is a function that has no return value and has an int parameter.

And that's how it ends.
Sigfunc *signal (int, sigfunc*)

China Open Source

Http://www.oschina.net/question/171512_63027#tags_nav

Left and right rules

Http://wenku.baidu.com/view/3891df0e844769eae009ed40.html

About the C language declaration void (*signal (int sig, Void (*FUNC) (int))) (int) is understood

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.