C language basic syntax

xiaoxiao2021-03-06  40

/ *

a) const Int a;

b) int const a;

c) Const Int * a;

d) INT * Const A;

e) int const * a const;

the answer is:

a) a is a constant number

b) a is a constant number

c) a is a pointer to the constant number (that is, the integer is unmodified, but the pointer can be)

d) A is a normally pointer to the whole number (that is, the integer of the pointer points to modify, but the pointer is not modified).

e) A is a normally pointer to the constant number (that is, the integer of the pointer is not modified, while the pointer is not modified).

* /

/ *

a) an integer (an integer)

b) a pointer to the integer (a Pointer to an INTEGER)

c) a pointer to the pointer, which pointing to the pointer to a constant number (a Pointer to a Pointer to an inTege)

d) A number of arrays with 10 integers (AN Array of 10 Integers)

e) A array of 10 pointers that point to a integer. (AN Array of 10 Pointers to Integers)

f) a pointer to having 10 integer numbers (a Pointer to an Array of 10 Integers)

g) a pointer to a function, which has a integer parameter and returns a integer (a pointer to a function what takes an integer as an argument and returns an integer)

h) A array with 10 pointers, which points to a function, which has a integer parameter and returns an integer (An Array Of Ten Pointers to Functions 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 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 Takes an integer argument and returns an integer

h) int (* a [10]) (int); // AN array of 10 Pointers to functions what take an integer argument and return an integer

* /

转载请注明原文地址:https://www.9cbs.com/read-75608.html

New Post(0)