由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 又问几个c语言编程的题目
相关主题
array of pointers to functionsInterview Question
One question about Void pointer (转载)问一个c++问题关于reference vs. pointer
C++ Q93 - Q95CareerCup 13.9的solution有memory leak
请教一个 c++ member function pointer 问题谁能解释下这道c++的面试题
来问一个关于smart pointer的弱问题C++ Q82: Can you assign a base pointer to a derived pointer?
c++ class default functions?问一个smart pointer的问题
C++: 如何对const data member做assignment?BOOST里的shared ptr比stl里的auto ptr好在哪里呢?
想请教一道面试题谁给改一个线程安全的smarter pointer类
相关话题的讨论汇总
话题: plant话题: int话题: status话题: operation话题: type
进入JobHunting版参与讨论
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
e********s
发帖数: 248
2
My answers: b a b a b a
r****o
发帖数: 1950
3
why 3rd is b?

【在 e********s 的大作中提到】
: My answers: b a b a b a
e********s
发帖数: 248
4
For #3, I am not too sure about a.
But for b, how about
== a.1
static int v;
do something with v;
== a.c
#include "a.1"
do something else with v;

【在 r****o 的大作中提到】
: why 3rd is b?
r****o
发帖数: 1950
5
This sounds good.

【在 e********s 的大作中提到】
: For #3, I am not too sure about a.
: But for b, how about
: == a.1
: static int v;
: do something with v;
: == a.c
: #include "a.1"
: do something else with v;

m********l
发帖数: 89
6
第三题a应该是错的 因为在embedded dev.里经常要这么做 前提是要把一个register映
射到某个内存位置上,例如:
volatile Uint32 *base = (volatile Uint32 *) 0x12345678;

function

【在 h*****g 的大作中提到】
: 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

1 (共1页)
进入JobHunting版参与讨论
相关主题
谁给改一个线程安全的smarter pointer类来问一个关于smart pointer的弱问题
这道题是选A 吗?c++ class default functions?
怎么准备一些hardcore C++的interviewC++: 如何对const data member做assignment?
问个关于c++ auto_pter的问题想请教一道面试题
array of pointers to functionsInterview Question
One question about Void pointer (转载)问一个c++问题关于reference vs. pointer
C++ Q93 - Q95CareerCup 13.9的solution有memory leak
请教一个 c++ member function pointer 问题谁能解释下这道c++的面试题
相关话题的讨论汇总
话题: plant话题: int话题: status话题: operation话题: type