由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 网上c sample question的一堆错误
相关主题
如何准备compiler的知识?我也发个工作
询问Bloomberg online skill assessmentC++ Q42: (C22)
给大家看几道C 小程序Mathworks is hiring! job #10319 - C++ Developer – Compile
问一个C的简单问题error of compiling C# in visual studio 2013 win 7
c interview questionCompiler/C++ position @Mathworks
请教C/C++小Just finished Google phone screen
在电脑上直接写程序Samsung实习电话面试
C++ template[合集] 几个面试中碰到的问题
相关话题的讨论汇总
话题: dependent话题: sizeof话题: char话题: compiler话题: array
进入JobHunting版参与讨论
1 (共1页)
g*******s
发帖数: 490
1
这边的c sample question
http://www.bestsamplequestions.com/technical-questions/c-sample-questions/c-sample-questions.html
列一下我发现的错误
第8
system dependent, be cautious of all sizeof questions, most of them are
system dependent
第10
system dependent, depends on the size of int
第11
compiler dependent
it's fine. 其实即使function的argument是数组形式,compiler也会自动改成指针,
just remember array is always
passed by its pointer in function calls
第16
won't print anything, 两个指针都没有allocate memory
第18
for declaration, it is not good, but legal
第19
wrong
第20
unspecified behavior, remember there is no GUARANTEED that an increment or
decrement is performed
immediately after giving up the previous value and before any other part of
the expression is evaluated
第22
char *p="hai friends",是 read-only, 而 ++*p++会尝试改变string的值
won't print anything
这题即使改成,char p[]="xxxx" 也不行,array不能++
第28
nonsense, sizeof is system dependent
第29
compiler dependent
第46
输出第2行第1个应该是112
第49
memory allocation please
题52
the string pointed by x is read only
题60
some compliers do not even let you declare "void v"
题61
sizeof again. and remember sizeof(array) returns the array's size, not
number of element. In this case, just
because sizeof(char) = 1, so num of element = size
65.
the check for leap year is actually
year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)
是4的倍数,但不是100的倍数,但可以是400的倍数
71.
memory allocation plz
and the output should be
garbagevalue..10
79.
some compilers do not report error
82.
explanation is wrong. The problem is that i should be int instead of char.
if i is char, the loop could be
infinite or never start
and
getc check EOF
gets check NULL
84.
compiler error
121.123.
string is read only
140.
unspecified behavior, implementation dependent
145.
x=8,y=10
q******8
发帖数: 848
2

身错误也比较多,列一下我发现的
错误
bloomberg的online testing在网上是不是有个题库之类的阿?c或者c++

【在 g*******s 的大作中提到】
: 这边的c sample question
: http://www.bestsamplequestions.com/technical-questions/c-sample-questions/c-sample-questions.html
: 列一下我发现的错误
: 第8
: system dependent, be cautious of all sizeof questions, most of them are
: system dependent
: 第10
: system dependent, depends on the size of int
: 第11
: compiler dependent

g*******s
发帖数: 490
3
没有题库,所以还是要准备的细致一点,多看看别的题目,比如上面的sample questions

【在 q******8 的大作中提到】
:
: 身错误也比较多,列一下我发现的
: 错误
: bloomberg的online testing在网上是不是有个题库之类的阿?c或者c++

1 (共1页)
进入JobHunting版参与讨论
相关主题
[合集] 几个面试中碰到的问题c interview question
Bloomberg on-site总结请教C/C++小
刚刚电面完bloomberg,提供一些题目,供大家参考在电脑上直接写程序
Anyone know code test for Two Sigma?C++ template
如何准备compiler的知识?我也发个工作
询问Bloomberg online skill assessmentC++ Q42: (C22)
给大家看几道C 小程序Mathworks is hiring! job #10319 - C++ Developer – Compile
问一个C的简单问题error of compiling C# in visual studio 2013 win 7
相关话题的讨论汇总
话题: dependent话题: sizeof话题: char话题: compiler话题: array