发信人: thrust (哼哼的多隆猪), 信区: Programming
标 题: Re: Anybody help me on these questions?
发信站: Unknown Space - 未名空间 (Wed Jun 16 21:56:27 2004), 转信
【 在 smectite (coolrant) 的大作中提到: 】
: Ok. I give you my ans and please help me check them.
: 1. p = buff(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.
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" 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.
: 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...
※ 修改:．thrust 于 Jun 16 21:57:53 修改本文．[FROM: 128.205.]
※ 来源:．Unknown Space - 未名空间 mitbbs.com．[FROM: 128.205.]