登 录
註 冊
论坛
微波仿真网
注册
登录论坛可查看更多信息
微波仿真论坛
>
聊天休息闲聊灌水
>
据说某手机公司的笔试题(c语言),有兴趣的 ..
发帖
回复
1522
阅读
2
回复
据说某手机公司的笔试题(c语言),有兴趣的看看
离线
tensor
新的一年开始了!
UID :2
注册:
2006-10-04
登录:
2025-09-29
发帖:
4229
等级:
值班管理员
0楼
发表于: 2007-11-22 22:33:48
— 本帖被 admin 从 手机天线 移动到本区(2007-11-25) —
?41bZ$j
据说某手机公司的笔试题(c语言),有兴趣的看看
io%WV%1_
F$.h+v
mhVdsa
1. Write a function that prints the binary representation of an unsigned integer using only putchar() for output
|L[/]@|
6hp>w{+
`fMdO
2. Memory Management/Pointer manipulation
L{1MyR7`I+
S3 12#X(%
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
:%7y6V*
', ~
Assume: All arguments are always valid
f8 E,.$>
+ -~8t^
The original string should remain untouched
2T 3tKX
KG<. s<
Use the following function prototype
$$F iCMI
6i'GM`>w
char * remove_substr(char *str, int pos, int length);
e}>3<Dh
xl2;DFiYt
3N c#6VI
3. Data structures
O/Cwm;&t
lt08 E2p9
Implement a circular queue of size n using an array. Use the given fragments for your implementation
Jx@_OE_vp
xKl\:}Ytp
typedef stuct QUEUE{
#0$fZ
^x2zMB\t
int head, tail;
uaghB,i'n
uJ-Q]yQ
void * data[N];
K93L-K^J
XX&4OV,^%D
}queue;
U/}YpLgdD
>vQ8~*xd
$-Iui0h
H j [!F%
void init-queue()
xnP@h
+*uaB
{
USd7gOq(
X'FDQoH
}
)hG4,0hv&
*).u:>D4
!aQb Kp
7md,!|m
int queue(void *data)
o-I:p$B -
Xna58KF/
{
CCDU5l$$
5tx!LGOK
}
tVQq,_9C
B703{k
void * dequeue()
w3Lr~_j
Y%9$!
{
Yo%ph%e
HOt,G _{
}
&fofFVQnW
Fz11/sKz
>PuQ{T I
4. Problem solving/operating systems
E<RPMd @a
J4?i\wD:
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.
Ua hsX
boS=
U45kA\[bZ
5. C syntax
GHNw.<`l?
6|uv+$
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)
?_ 476A
G+7#!y Y
void init_array(unsigned int array[])
Upw`|$1S
QjOO^6Fh
{
f8e :J#jbS
PH.g+u=v
int size = sizeof(array);
BTc }Kfae
e dTFk$0
int i;
d!{]CZ"@
`6y=ky.,
for(i=0; i<size; i++)
=E.!Ff4~(
&cGa~#-u
array
=-1;
,>!%KYD/f
Znw3P|>B
}
ylm #Xa
8Sxk[`qx\K
void main()
w)N~u%
m^%@bu,
{
rMWJ
2OVN9_D%
char * string=”Here is rather long constant to fit my needs”;
^'\JI
Ie4\d2tQ;
char * another_string;
&&% oazR=
@eJ6UML"
unsigned int array[11];
mF:Pplf<
C19}Y4r:
init_array(&array[0]);
CY~ S{w
) >te|@}o
another_string=(char*)malloc(strlen(string));
-*A1[Z ?
zfrNM9C
&nbs ..
F[(ocxQZ3
tm&,u*6$W?
未注册仅能浏览
部分内容
,查看
全部内容及附件
请先
登录
或
注册
共
条评分
本人从事微波行业研究和教学。丰富的硬件资源和微波团队可
承接各类与微波相关的项目 QQ:546874678 EMAIL:rfeda@126.com
离线
ych142
赠人玫瑰手有余香
UID :1746
注册:
2007-04-12
登录:
2020-02-05
发帖:
436
等级:
退休版主
1楼
发表于: 2007-11-25 22:59:54
4E2#krE%
tensor老大这个贴是不是发的不是地方呀,呵呵
共
条评分
学习中。。。
离线
zhaoyi821205
做大事,本乎机;成大事,存乎会
UID :1147
注册:
2007-03-09
登录:
2020-03-05
发帖:
319
等级:
特邀技术顾问
2楼
发表于: 2007-12-02 20:54:32
c;]^aaQ+>
提到软件,我就头痛啊.
共
条评分
我来也.哈哈.
发帖
回复