| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2056 人关注过本帖
标题:[讨论][转载][讨论]某外企C语言面试题,看你能答对几道!
只看楼主 加入收藏
mondear
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-6-13
收藏
 问题点数:0 回复次数:22 
[讨论][转载][讨论]某外企C语言面试题,看你能答对几道!
Question Setup:
-------------------
int a=1;
int b=2;
int c=3;

int *p;
int *q;
-------------------
Q1:
initialize p to point to a
initialize q to point to b
A1:

-------------------
Q2:Using Q1 setup and answer, what is value of *p and *q?
A2:
-------------------
Question Setup:
-------------------
int a=1;
int b=2;
int c=3;

int *p;
int *q;

c=*p;
p=q;
--------------------
Q3:what are the values of *p and *q and c?
A3:
--------------------
Question setup:
--------------------
int *p;
int *q;
*p=12;
q=p;
--------------------
Q4:what is value of q?
A4:
--------------------
Question Setup:
--------------------
void foo()
{
int a=1;
int b=2;
bar(a);
bar(b);
}
void bar(int p)
{
int q;
q=p+2;
}
--------------------
Q5:what are values of integers a and b end of foo()?
A5:
--------------------
Q6:Modify the above functions,using pointers,so values at the end of
foo() are a=3 and b=4
A6:
-----------------------
LINKED LIST BASICS
Q7:what is an example of a structure and pointer to that structure?
A7:
------------------------
Q8:use the struct pointer created above to assign a member of the structure
the value 5?
A8:
---------------------
Q9:allocate a structure to be used in a single data integer linked list
A9:
--------------------
Q10:Use the linked list data structure above to create a function that
builds a list of {1,2,3} and returns pointer to beginning of list.
A10:
--------------------
Q11:Write a function to count number of elements in the list
A11:
--------------------
ADVANCED LINKED LIST EXAMPLE
Q12:Use the code snippet below.what do you call this type of function?Summariz
e
the basic operation using assumptions about the data structure.
---------------------------------------------------------------------
struct FileEntry
{
int m_iDecoder;
struct FileEntry *m_pNext;
struct FileEntry *m_pContents;
struct FileEntry *m_pContainer;
int m_iFCBEntry;
};

RETCODE_reentrant FooBar(struct FileEntry *pEntry)
{
RETCODE rtn=!SUCCESS;

if(g_iTotalTracks<MAX_FILES&&pEntry->m_iDector!=FILE_ENTRY_UNUSED)
{
if(pEntry->m_iDector==FILE_ENTRY_DIR)
{
struct FileEntry *pCurrentEntry=pEntry->m_pContents;
while(pCurrentEntry)
{
FooBar(pCurrentEntry);
pCurrentEntry=pCurrentEntry->m_pNext;
}
}
else
{
g_PlayList[g_iTotalTracks]=pEntry;
g_iTotalTracks++;
}
}
rtn=SUCESS;

}
return rtn;
}
---------------------------------------------------------

THE END
搜索更多相关主题的帖子: C语言 外企 答对 面试 
2006-06-13 00:21
–★–
Rank: 3Rank: 3
等 级:新手上路
威 望:6
帖 子:1512
专家分:0
注 册:2006-5-1
收藏
得分:0 
Question Setup:
-------------------
int a=1;
int b=2;
int c=3;

int *p;
int *q;
-------------------
Q1:
initialize p to point to a
initialize q to point to b
A1: p = &a;
q = &b;
-------------------
Q2: Using Q1 setup and answer, what is value of *p and *q?
A2: 1,2
-------------------
Question Setup:
-------------------
int a=1;
int b=2;
int c=3;

int *p;
int *q;

c=*p;
p=q;
--------------------
Q3: what are the values of *p and *q and c?
A3: error in your question !
--------------------
Question setup:
--------------------
int *p;
int *q;
*p=12;
q=p;
--------------------
Q4: what is value of q?
A4: wild pointer p !!!
--------------------

落霞与孤鹜齐飞,秋水共长天一色! 心有多大,路有多宽。三教九流,鸡鸣狗盗。兼收并蓄,海纳百川。
2006-06-13 06:16
hao0716
Rank: 4
等 级:业余侠客
威 望:1
帖 子:353
专家分:222
注 册:2006-4-11
收藏
得分:0 
Q5:what are values of integers a and b end of foo()?
A5: a=1 b=2
米想到我上面的和星星一样

2006-06-13 09:21
mondear
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-6-13
收藏
得分:0 

大家难道对这样的题目不感兴趣?特别是最后一题!

2006-06-13 09:27
–★–
Rank: 3Rank: 3
等 级:新手上路
威 望:6
帖 子:1512
专家分:0
注 册:2006-5-1
收藏
得分:0 
大家对有语法错误的题目不感兴趣!
例如最后一题,花括弧都不匹配,咋做?

落霞与孤鹜齐飞,秋水共长天一色! 心有多大,路有多宽。三教九流,鸡鸣狗盗。兼收并蓄,海纳百川。
2006-06-13 10:20
baidu
Rank: 3Rank: 3
等 级:新手上路
威 望:8
帖 子:3811
专家分:0
注 册:2005-11-4
收藏
得分:0 
作业就作业,什么外企C语言面试题

偶放弃所有文章版权,偶在BCCN论坛任何贴子,可转贴,可散发,可抄袭,可复制,可被冒名顶替,可被任何人引用到任何文章中且不写出引文出处,偶分文不取。
2006-06-13 10:26
anthony634
Rank: 6Rank: 6
来 自:西南交大
等 级:贵宾
威 望:24
帖 子:653
专家分:10
注 册:2006-6-8
收藏
得分:0 
考英文的吧
2006-06-13 12:48
金为床兮银为椅
Rank: 1
等 级:新手上路
帖 子:183
专家分:0
注 册:2006-3-20
收藏
得分:0 

不做不知道,一做吓一跳。

唉,基础太差!基本概念竟要查书,看来能编写代码解决问题,不一定就是学会了。

弄点补品好好补补。。。。


努力学习C、C++、LINUX、ORACLE、ENGLISH,累死为止。
2006-06-13 13:20
mondear
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-6-13
收藏
得分:0 
晕倒,要是作业题,有必要搞成英文的么?!!
2006-06-13 16:00
编程女孩
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2006-6-12
收藏
得分:0 
Question Setup:
-------------------
int a=1;
int b=2;
int c=3;

int *p;
int *q;
-------------------
Q1:
initialize p to point to a
initialize q to point to b
A1:
p =&a; q =&b;
-------------------
Q2:Using Q1 setup and answer, what is value of *p and *q?
A2:
*p =1; *q =2;
-------------------

2006-06-13 17:26
快速回复:[讨论][转载][讨论]某外企C语言面试题,看你能答对几道!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015489 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved