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

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

2006-06-13 09:27
mondear
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-6-13
收藏
得分:0 
晕倒,要是作业题,有必要搞成英文的么?!!
2006-06-13 16:00
mondear
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-6-13
收藏
得分:0 
To:编程女孩

Q6:Modify the above functions,using pointers,so values at the end of
foo() are a=3 and b=4
A6:
这个是正确的



我觉得你对题目的意思理解有误,不是让你判断对错,
它意思是让你修改程序,用上指针,且运行foo()后 a=3 and b=4



2006-06-13 18:03
mondear
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-6-13
收藏
得分:0 
To:编程女孩
第三题答错了吧?
九到十一要求用纯C写的
十二题没答到点子上(
what do you call this type of function?
2006-06-14 09:00
快速回复:[讨论][转载][讨论]某外企C语言面试题,看你能答对几道!
数据加载中...
 
   



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

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