Help you parse Complex C language statements

Source: Internet
Author: User

Many C/C ++ beginners are often confused by complicated statements. For example:Char * (* A []) (),What does this statement mean?

You don't have to worry about it. In a Linux environment, there is a tool that can help us resolve it. It is cdecl. It can be converted between C/C ++ and English. Let's take a look at the description in man cdecl:

Description
Cdecl (and C ++ Decl) is a program for encoding and decoding C (or C ++) type declarations. the C language is based on the (draft proposed) x3j11 ANSI standard; optionally, the C language may be based on the pre-ANSI definition defined by kernighan & Ritchie's the C programming language book, or the C language defined by the Ritchie PDP-11 C compiler. the C ++ language is based on Bjarne stroustrup's the C ++ pro-gramming language, plus the version 2.0 additions to the language.

It is easy to use: Enter the cdecl command to enter the interactive interface:

# Cdecl
Type 'help' or '? 'For help
Cdecl>

Enter the following command:

Explain char * (* A []) ()

Let's see what the output is:

Declare a as array of pointer to function returning pointer to Char
Cdecl>

In turn, let's take a look at the output English as a command and execute it again:

Cdecl> declare a as array of pointer to function returning pointer to Char
Char * (* A []) ()
Cdecl>

Easy to use. If you do not understand it, please help.

In Hangzhou

Related Article

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.