h*****g 发帖数: 944 | 1 Q1)
what are the variable types in the statement below?
int * x, y;
a) both x and y are of type int *
b) x is of type int* and y is of type int
c) x is of type int and y is of type int*
d) both x and y are of type int
我选的是b
Q2)
which of the following is a correct declaration for a pointer to a function
that returns a double and takes no arguments?
a) double (*ptr_function)(void);
b) double (ptr_function)(void);
c) double ptr_function(void);
d) double *ptr_function(void);
Q3)
Which of the following statements is false?
a) It is not legal to take the address of a register variable.
b) a static variable is never visible in more than one file
c) declaring an extern variable allows access to another files variable
d) void pointers need an explicit cast when copied to non-void pointers
Q4
Which of the following pairs of statements correctly uses a typedef to
create the new name COUNT of type int and declare instances of type
COUNT called people and dogs?
a) typedef int COUNT; COUNT people, dogs
我选的这个应该没错吧?
Q5
Which of the following correctly declares an instance of the enumeration
plant_status named plant and assigns it the status full_operation?
A) enum plant_status plant=plant_status.full_operation;
b) enum plant_status plant=full_operation;
c) plant_status plant=plant_status.full_operation
d) plant_status plant=full_operation;
e) enum plant_status{full_operation, limited_operation};
Q6
which of the following is true of when memory is dynamically allocated used
malloc() or calloc()?
a) that memory must be deallocated with the free() function
b) that memory must be deallocated with the demalloc() function
c) that memory must be deallocated with the delete operator
d) that memory will be deallocated by the built in garbage collection |
|