当前在线人数15474
首页 - 分类讨论区 - 电脑网络 - 葵花宝典版 -阅读文章
未名交友
[更多]
[更多]
文章阅读:Anybody help me on these questions?
[同主题阅读] [版面: 葵花宝典] [作者:smectite] , 2004年06月16日17:37:30
smectite
进入未名形象秀
我的博客
[上篇] [下篇] [同主题上篇] [同主题下篇]

发信人: smectite (coolrant), 信区: Programming
标  题: Anybody help me on these questions?
发信站: Unknown Space - 未名空间 (Wed Jun 16 17:37:30 2004) WWW-POST


LINE Contains
50 char * b, q, *r;
200 b=getbuf();
201 q = *b;
212 r= anotherfunction(b);
213-300 /* we want to use ‘q’ and  ‘r’ here*/
2000 char * getbuf()
2001 {
2002    char buff[8];
2003-2050 /* unspecified, buff defined here *./
2051   return (char *) buff;
2052 }

1. What will be in variable ‘q’ after line 201 is executed?  Under what
conditions might this not be so?
2. Is there an alternative, but equivalent, way to write line 2000?  If so,
what is it?
3. Is getbuf() a reasonable function? 
4. Will getbuf() execute at all?
5. Please comment on line 2051.
6. Is getbuf() good practice, and why?
7. What line not given should be provided for compilation?
8. How, exactly, could one get a second ‘char *’ to use back from this
function?  Be specific in terms of the exact syntax needed.  (That is, provide
code.)  Another way to state this question is how can this function be
modified to return a ‘char *’ (that is, it maintains the same return type)
from the function, and an additional ‘char *’ value in one function call.
Please make sure that your answer will work even if the size of the char *
desired is not known in the outside calling function.  Avoid (do not use) C++
syntax.  Include statements in called and calling functions.  Use good
programming practice.
9. For those candidates who know SQL: There is a table  with gene_ids (‘gid’
) and clone_ids (‘cid’).  Each gene only resides on a single clone and each
clone may contain multiple genes.  How do you find how many genes are on each
and every clone?  Please provide the SQL.
10. What's the difference between system calls and library functions?
From a programming perspective, there is no difference between a system call
or any other function call.



--
※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 128.123.]

[上篇] [下篇] [同主题上篇] [同主题下篇]
[转寄] [转贴] [回信给作者] [修改文章] [删除文章] [同主题阅读] [从此处展开] [返回版面] [快速返回] [收藏] [举报]
 
回复文章
标题:
内 容:

未名交友
将您的链接放在这儿

友情链接


 

Site Map - Contact Us - Terms and Conditions - Privacy Policy

版权所有,未名空间(mitbbs.com),since 1996