Basic C language syntax

Source: Internet
Author: User
/*
 
A) const int;
B) int const;
C) const int *;
D) int * const;
E) int const * a const;
 
The answer is:
A) A is a constant integer.
B) A is a constant integer.
C) A is a pointer to the constant integer number (that is, the integer number cannot be modified, but the pointer can be)
D) A is a constant pointer to an integer (that is, the integer to which the Pointer Points can be modified, but the pointer cannot be modified ).
E) A is a constant pointer to a constant INTEGER (that is, the pointer to an integer cannot be modified, and the pointer cannot be modified ).
 
*/
 
/*
 
A) An integer)
B) a pointer to an integer (a pointer to an integer)
C) a pointer to a pointer pointing to an integer (a pointer to an intege) r
D) an array of 10 integers (an array of 10 integers)
E) an array with 10 pointers pointing to an integer. (An array of 10 pointers to integers)
F) A pointer to an array with 10 integers (a pointer to an array of 10 integers)
G) a pointer to a function. The function has an integer parameter and returns an integer number (a pointer to a function that takes an integer as an argument and returns an integer)
H) An array with 10 pointers pointing to a function, this function has an integer parameter and returns an integer (an array of ten pointers to functions that take an integer argument and return an integer)
 
The answer is:
A) int A; // an integer
B) int * A; // a pointer to an integer
C) int ** A; // a pointer to an integer
D) int A [10]; // an array of 10 Integers
E) int * A [10]; // an array of 10 pointers to Integers
F) int (* A) [10]; // a pointer to an array of 10 Integers
G) int (* A) (INT); // a pointer to a function a that takes an integer argument and returns an integer
H) int (* A [10]) (INT); // an array of 10 pointers to functions that take an integer argument and return an integer
 
*/
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.