由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 又问几个c语言编程的题目
相关主题
typedef 的一个问题Question: Given a pointer to a function
c++ 里面 this pointer 是完全 un necessary 的吗?请问const myClass &src 和myClass const &src有什么区别?
请问可以这样定义struct吗?pointer to function
再请教一个c++的简单问题(enumerated constant)出个题考考大家:)
c++ template question:C++里get array size的问题 (转载)
问个 enum{}的问题 谢谢 (转载)One question about Void pointer
{C语言}请教如何通过变量访问结构体内的各个属性Questions about c code
C++ Q05: pointer to constant variableC++ Q93 - Q95 (转载)
相关话题的讨论汇总
话题: plant话题: status话题: int话题: operation话题: type
进入Programming版参与讨论
1 (共1页)
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
1 (共1页)
进入Programming版参与讨论
相关主题
C++ Q93 - Q95 (转载)c++ template question:
int (*b)[2]; 是什么意思?问个 enum{}的问题 谢谢 (转载)
C++ 菜鸟问一个关于template 的问题。{C语言}请教如何通过变量访问结构体内的各个属性
问一声大牛,c++不用pointer怎么编程?C++ Q05: pointer to constant variable
typedef 的一个问题Question: Given a pointer to a function
c++ 里面 this pointer 是完全 un necessary 的吗?请问const myClass &src 和myClass const &src有什么区别?
请问可以这样定义struct吗?pointer to function
再请教一个c++的简单问题(enumerated constant)出个题考考大家:)
相关话题的讨论汇总
话题: plant话题: status话题: int话题: operation话题: type