昨天突然接到一个电话面试

winter_plusplus 2007-04-11 08:31:14
昨天晚上突然接到一个电话,问了三个问题。
1.处理字符串应该注意哪些?
2.什么时候用单向链表,什么时候用双向链表?
3.指针和数组名有什么区别?

太突然了,感觉回答的很差,不知道大家有没有过电话面试,都问些什么东西?
...全文
773 24 打赏 收藏 转发到动态 举报
写回复
用AI写文章
24 条回复
切换为时间正序
请发表友善的回复…
发表回复
withcsharp 2007-04-11
  • 打赏
  • 举报
回复
俺 好像都不会

1.处理字符串应该注意哪些?
2.什么时候用单向链表,什么时候用双向链表?
3.指针和数组名有什么区别?
char
int
totoorange 2007-04-11
  • 打赏
  • 举报
回复
问的比较理论
Generics 2007-04-11
  • 打赏
  • 举报
回复
我接过好几次电话面试了。最烦人的一个问题(还老问)就是,how do you scale your C/C++ skill if the rate is from 0 to 10? 我TM一开始还比较谦虚,支吾了一会儿,就说大概6到7吧(毕竟C++里很多猫腻我确实不大了解)。然后对面就是一阵难堪的沉默,然后就说"I will contact you later". 我TM现在学乖了,问我rate, 我毫不犹豫地说8-9。谁TM谦虚谁就是孙子啊!
dashi 2007-04-11
  • 打赏
  • 举报
回复
接分~
thinkinnight 2007-04-11
  • 打赏
  • 举报
回复
这样看来,就是严格与系统相关了。
下次问,就让他看climits里面
thinkinnight 2007-04-11
  • 打赏
  • 举报
回复
看了一下,大概是
C++的内存最小单元为byte,但是byte中存bit的数目是implementation-defined.
The sizeof operator yields the number of bytes in the object representation of its operand.
sizeof(char), sizeof(signed char) and sizeof(unsigned char) are 1; the
result of sizeof applied to any other fundamental type is implementation-defined.
holmesye 2007-04-11
  • 打赏
  • 举报
回复
通信软件注重性能,华为的面试题无非都是这些。
不过还是要注重整体的水平,最重要还是方法~

内存泄露推荐purify哈
thinkinnight 2007-04-11
  • 打赏
  • 举报
回复
汗颜,ISO14882,下下来后没看过,还是习惯看书,没习惯看标准啊
ChumpKlutz 2007-04-11
  • 打赏
  • 举报
回复
没经历过电话面试,楼主别被人耍了,还是晚上啊
ch1oE 2007-04-11
  • 打赏
  • 举报
回复
补充:指针和数组名的区别
数组就是指针
指针并不都是数组
因为数组有界指针没届
(原因是不管什么形式的C++数组都没有内置数组大小的概念)
所以谁也不敢保证你
int flag[10]={0};之后的*(flag10+1);是什么东西~



补充:静态局部变量和全局变量的区别
可以把静态局部变量看作是---只能在特定作用域访问的全局变量。


补充:私有继承(private)和公有(public)继承的区别
这样表示父类的public和private方法与数据成员在子类环境中都变成了private。
使用这样的方式虽然会降低父类的访问权限,但可以隐藏很多~~~算是内部结构吧~


可以参看<<Professional C++>>


关于内存泄漏
说实话,如果内存泄漏已经发生(程序不好再修改),那就只能使用一些专门软件进行调试
据说valgrind不错的
个人觉得比较好的预防方法是使用 智能指针


关于int的分类
...实在不清楚这个是从哪个角度问的...
难以理解...
wangzhangyong411 2007-04-11
  • 打赏
  • 举报
回复
没经历过电话面试.....

强..

问的问题倒是挺一般的

Benny_ywb 2007-04-11
  • 打赏
  • 举报
回复
华为的,char,int型多少长度
eeyyllehs 2007-04-11
  • 打赏
  • 举报
回复
夜袭?
Wolf0403 2007-04-11
  • 打赏
  • 举报
回复
又忘了,哎。

C++03 是 C++ 的 ISO 标准 2003 版,标准号。。网上查吧。
thinkinnight 2007-04-11
  • 打赏
  • 举报
回复
请问一下C++03是指的哪本?不是很清楚。

这个问题我已经在C++ FAQ上找到了。
Here are the rules:

* The C++ language gives the programmer the impression that memory is laid out as a sequence of something C++ calls "bytes."
* Each of these things that the C++ language calls a byte has at least 8 bits, but might have more than 8 bits.
* The C++ language guarantees that a char* (char pointers) can address individual bytes.
* The C++ language guarantees there are no bits between two bytes. This means every bit in memory is part of a byte. If you grind your way through memory via a char*, you will be able to see every bit.
* The C++ language guarantees there are no bits that are part of two distinct bytes. This means a change to one byte will never cause a change to a different byte.
* The C++ language gives you a way to find out how many bits are in a byte in your particular implementation: include the header <climits>, then the actual number of bits per byte will be given by the CHAR_BIT macro.

不过我还是想看一下C++03.
Wolf0403 2007-04-11
  • 打赏
  • 举报
回复
>> char可不一定是八位。

C++ FAQ ms 是这样承诺的。。
BluntBlade 2007-04-11
  • 打赏
  • 举报
回复
看C++03去吧,第一章的,好像是第九节,实现相关的内容。
thinkinnight 2007-04-11
  • 打赏
  • 举报
回复
有请星星指教
BluntBlade 2007-04-11
  • 打赏
  • 举报
回复
char可不一定是八位。
不想低调 2007-04-11
  • 打赏
  • 举报
回复
帮顶
加载更多回复(4)

15,440

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧