登 录
註 冊
论坛
微波仿真网
注册
登录论坛可查看更多信息
微波仿真论坛
>
聊天休息闲聊灌水
>
据说某手机公司的笔试题(c语言),有兴趣的 ..
发帖
回复
1521
阅读
2
回复
据说某手机公司的笔试题(c语言),有兴趣的看看
离线
tensor
新的一年开始了!
UID :2
注册:
2006-10-04
登录:
2025-09-29
发帖:
4229
等级:
值班管理员
0楼
发表于: 2007-11-22 22:33:48
— 本帖被 admin 从 手机天线 移动到本区(2007-11-25) —
5 89P$2e1X
据说某手机公司的笔试题(c语言),有兴趣的看看
qkA8q@Y4|
ddwokXx (
B)BR y%
1. Write a function that prints the binary representation of an unsigned integer using only putchar() for output
.\7AJB\l
u,JUMH]@
30bdcDm,
2. Memory Management/Pointer manipulation
v<vaPvW
fS]Z`U"
Write a function that allows you to remove a substring from a string and returns a new string that uses only the amount of storage needed
d Z}|G-:
jE2EoQi,
Assume: All arguments are always valid
]92=PA>75
,!QtViA7
The original string should remain untouched
|&_(I
qoSZ+ khS$
Use the following function prototype
w3FEX$`_
V?- ]ZkI
char * remove_substr(char *str, int pos, int length);
3oMa
IweNe`Z
/Q2HN(Y
3. Data structures
+R',$YzD
g4Nl"s*~
Implement a circular queue of size n using an array. Use the given fragments for your implementation
Qov*xRO6
i> dLp
typedef stuct QUEUE{
E&;;2
=}%Q}aPp
int head, tail;
;umbld0
;~Gez;AhK
void * data[N];
o('6,D
ut^6UdJ+`
}queue;
br')%f}m
5l]qhi3f
vlo!D9zsV3
dZ x
void init-queue()
d0YQLh
=%d.wH?dZ/
{
J@qwz[d i
/Zg4JQ~
}
wPvYnhr|G-
:8U@KABH@h
,[[Xo;q
wg^'oy
int queue(void *data)
KeWIC,kq
&%4A3.qE
{
y'_2|5!Qs
A\v]ZN4
}
a"8H(HAlNn
A5~OHmeK
void * dequeue()
sOm&7A?
MPMAFs
{
d5'4RYfkQ
>2mV{i&
}
%[OZ;q& X
Bp/25jy
|u.3Tp|3W
4. Problem solving/operating systems
\9 k3;zw
S$qpClXS,
A multitasking OS has a producer program that writes data to a buffer and consumer one that reads that data and prints it. Show the work that needs to be done to make sure this works smoothly.
BOme`0A
;FnS=Z
ztC>*SX
5. C syntax
vvP]tRZ
8aI^vP"7`=
Identify all the errors in the following piece of C code. Assuming you fix it so it compiles correctly. What would it print? (be sure to specify any assumptions)
*l)}o4-$
_ .xicov
void init_array(unsigned int array[])
3aFD*S
Nc*z?0wP
{
W];l[D<S*
}LryRcrD-n
int size = sizeof(array);
Y{<SD-ibZ$
_+d*ljP)l3
int i;
v\R-G
vAzSpiv-
for(i=0; i<size; i++)
Hd{@e6S
c\VD8 :
array
=-1;
Asli<L(?`
_f@nUv*
}
lI;ACF^
ldr~=<hsZ
void main()
Rw|P$dbu
~T9wx
{
m{by%
U,V+qnS
char * string=”Here is rather long constant to fit my needs”;
i'z(`"
Jm-bE 8b
char * another_string;
Hli22~7T:
7w.9PNhy
unsigned int array[11];
Ub`vf4EB
R/kF,}^F
init_array(&array[0]);
{YEGy
SA{5A 1
another_string=(char*)malloc(strlen(string));
-EG=}uT['b
k; ned
&nbs ..
._6e#=
sfs2ki H
未注册仅能浏览
部分内容
,查看
全部内容及附件
请先
登录
或
注册
共
条评分
本人从事微波行业研究和教学。丰富的硬件资源和微波团队可
承接各类与微波相关的项目 QQ:546874678 EMAIL:rfeda@126.com
离线
ych142
赠人玫瑰手有余香
UID :1746
注册:
2007-04-12
登录:
2020-02-05
发帖:
436
等级:
退休版主
1楼
发表于: 2007-11-25 22:59:54
$~NB .SY
tensor老大这个贴是不是发的不是地方呀,呵呵
共
条评分
学习中。。。
离线
zhaoyi821205
做大事,本乎机;成大事,存乎会
UID :1147
注册:
2007-03-09
登录:
2020-03-05
发帖:
319
等级:
特邀技术顾问
2楼
发表于: 2007-12-02 20:54:32
=|_k a8{?
提到软件,我就头痛啊.
共
条评分
我来也.哈哈.
发帖
回复