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

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

Thanks a lot, man. Since we have the same thoughts about Q2. and Q5. I will
take them as my final answers even I am still not sure of them.
About Q8. I am thinking two ways to solve it, but I am not sure if I get the Q
or not.
1. Use a struct as the return type. such as
struct A { char *a; char*b}; (The question here is not able to maintain the
return type of the function)
2. Another one is such as "char * getbuff(char *a);


【 在 thrust (哼哼的多隆猪) 的大作中提到: 】
: 【 在 smectite (coolrant) 的大作中提到: 】
: : Ok. I give you my ans and please help me check them.
: : 1. p = buff[0](actually buff[] is gone.) So if the memory that buff[] has
is
: : relocated to some other program right before lvalue b can be assigned to
point
: : to that memery space, we will not be able to get buff[0].
: basically right. i might add that, since buff[] is on stack, it is  very
: easy to get  destroyed very quickly.
: : 2. ???
: not very sure, probably he means char * getbuf(void)?
:
: : 3. Yes. But line 2002 should be "static char buff[8]" to return array
buff[].
: I would not call that reasonable. after adding static, it is ok, but still
: not very good.
: : 4. Yes it will be excuted.
: fine
: : 5. ???
: not sure what he want. but 2051 is fine. however you don't need the cast.
:
: : 6. No. the reason is in 1. and 3.
: : 7. char * anotherfunction(char*);
: probably you need an additional "char* getbuf()" before invoking it,
: but it will probably pass the compile.
: : 8. ???
: probably my english is so bad, but i don't understand the question very
well.
: if he need a function somewhat like malloc(), then just call malloc.
:
: : 9. select count(gid)
: : from tablename
: : group by cid
: i don't practice sql...
:
: : 10. can be found in google.【 在 thrust (哼哼的多隆猪) 的大作中提到: 】
: : : well...i won't help you since you didn't present
: : : your own thinking at all...
:
:


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

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

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

友情链接


 

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

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