由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 今天最后几个c语言编程的问题
相关主题
请教一个const和non const的C++问题这个拷贝构造函数有什么问题?
static initialization dependency c++ (转载)搞不清C++里的constant expression
面试就是面试问题,跟实际问题差太远攒rp,电面题目
攒人品之facebook电面面经几个多次被问到的c++问题请教
facebook HR 电面【设计模式】要达到啥水平?
再问C++问个弱智java问题
最新某公司onsite面试题怎么准备一些hardcore C++的interview
C++: 如何对const data member做assignment?发几个C++面试题,senior的职位
相关话题的讨论汇总
话题: const话题: variable话题: count话题: loop话题: following
进入JobHunting版参与讨论
1 (共1页)
h*****g
发帖数: 944
1
Q1. Which of the following statements about the const qualifier is false?
a) A const variable much be initialized during declaration.
b) no explicit cast is required when converting from non-const to const
c) It is not legal to declare a variable both const and volatile
d) Const pointers are allowed in C
这个是不是选a啊?
Q2. Safe Programming Question
Which of the following will not have undefined behavior?
a) x+= ++i + ++i;
b) i+= ++i;
c) x += ++i;
d) x += ++i + --i;
貌似都能跑啊?到底啥叫underdefined behavior?
Q3)
what's wrong with the following piece of code?
float count=0.0;
while(count!=1000000.0){
...some code here...
count=count+1.0;
}
a) It is not legal to use a float variable as a loop variable.
b) This loop may not stop due to rounding error in the loop variable
c) 1000000.0 is too large to be represented as a floating point number.
d) count must be incremented by 1 not 1.0
t*****j
发帖数: 1105
2
q3 选 b
其他的两个我也不确定。

【在 h*****g 的大作中提到】
: Q1. Which of the following statements about the const qualifier is false?
: a) A const variable much be initialized during declaration.
: b) no explicit cast is required when converting from non-const to const
: c) It is not legal to declare a variable both const and volatile
: d) Const pointers are allowed in C
: 这个是不是选a啊?
: Q2. Safe Programming Question
: Which of the following will not have undefined behavior?
: a) x+= ++i + ++i;
: b) i+= ++i;

P*******b
发帖数: 1001
3
我选a c b

【在 h*****g 的大作中提到】
: Q1. Which of the following statements about the const qualifier is false?
: a) A const variable much be initialized during declaration.
: b) no explicit cast is required when converting from non-const to const
: c) It is not legal to declare a variable both const and volatile
: d) Const pointers are allowed in C
: 这个是不是选a啊?
: Q2. Safe Programming Question
: Which of the following will not have undefined behavior?
: a) x+= ++i + ++i;
: b) i+= ++i;

m********l
发帖数: 89
4
第二题应该是b吧 += 和 ++的优先级是一样的?

【在 h*****g 的大作中提到】
: Q1. Which of the following statements about the const qualifier is false?
: a) A const variable much be initialized during declaration.
: b) no explicit cast is required when converting from non-const to const
: c) It is not legal to declare a variable both const and volatile
: d) Const pointers are allowed in C
: 这个是不是选a啊?
: Q2. Safe Programming Question
: Which of the following will not have undefined behavior?
: a) x+= ++i + ++i;
: b) i+= ++i;

p*********w
发帖数: 23432
5
Q2 这种是学术性弯弯绕的问题,根本不实用,没有任何的可读性可维护性。

【在 h*****g 的大作中提到】
: Q1. Which of the following statements about the const qualifier is false?
: a) A const variable much be initialized during declaration.
: b) no explicit cast is required when converting from non-const to const
: c) It is not legal to declare a variable both const and volatile
: d) Const pointers are allowed in C
: 这个是不是选a啊?
: Q2. Safe Programming Question
: Which of the following will not have undefined behavior?
: a) x+= ++i + ++i;
: b) i+= ++i;

1 (共1页)
进入JobHunting版参与讨论
相关主题
发几个C++面试题,senior的职位facebook HR 电面
T offer, Should I go?再问C++
[合集] 几个面试中碰到的问题最新某公司onsite面试题
C++ Q83: 这个const_cast什么意思?C++: 如何对const data member做assignment?
请教一个const和non const的C++问题这个拷贝构造函数有什么问题?
static initialization dependency c++ (转载)搞不清C++里的constant expression
面试就是面试问题,跟实际问题差太远攒rp,电面题目
攒人品之facebook电面面经几个多次被问到的c++问题请教
相关话题的讨论汇总
话题: const话题: variable话题: count话题: loop话题: following