avatar
请问什么是神医!?# PennySaver - 省钱一族
f*1
1
【 以下文字转载自 Programming 讨论区 】
发信人: falcon8241 (falcon), 信区: Programming
标 题: A weird C programming language--Return a pointer to array
发信站: BBS 未名空间站 (Wed May 29 13:54:54 2013, 美东)
A question I encountered during the interview. Could anyone give me some
idea.
The key issue is I was asked to modify line 500, which is the function
declaration...
Is there a different way to write line 500 which preserves the same
effective prototype? If so, what is it?
Line in file
Code:
30 int * someIDs, theFirst, *r;
110 someIDs =GetSomeIDs(); /* defined below */
111 theFirst = someIDs [0];
112 r= ReorderIDs(someIDs);
113-150 /* we want to use ‘theFirst’ and ‘r’ here*/

499 /*-------- GetSomeIDs-----*/
500 int * GetSomeIDs()
501{
502 int ids[8];
503-550 /* The ids are defined here */
551 return ids;
552}
avatar
r*e
2
给学生发信用卡邀请
是白发,申请只能被reject。 因为学生无收入。 除非乱填收入。 但被查出来就不值了
。 这个讲法对否?
★ 发自iPhone App: ChineseWeb 1.0.1
★ 发自iPhone App: ChineseWeb 1.0.1
avatar
b*f
3
谢谢
avatar
c*y
4
这么改?
void GetSomeIDs(int*& x){
int ids[8];
/* The ids are defined here */
x = ids;
}
avatar
l*y
5
为啥学生就没收入
就算没奖学金的,家里不给钱么,那吃啥

【在 r******e 的大作中提到】
: 给学生发信用卡邀请
: 是白发,申请只能被reject。 因为学生无收入。 除非乱填收入。 但被查出来就不值了
: 。 这个讲法对否?
: ★ 发自iPhone App: ChineseWeb 1.0.1
: ★ 发自iPhone App: ChineseWeb 1.0.1

avatar
l*u
6
去EBIZ, 那里全是神医.
avatar
S*I
7
返回指向局部变量的指针,这个函数压根就是错的嘛。

【在 f********1 的大作中提到】
: 【 以下文字转载自 Programming 讨论区 】
: 发信人: falcon8241 (falcon), 信区: Programming
: 标 题: A weird C programming language--Return a pointer to array
: 发信站: BBS 未名空间站 (Wed May 29 13:54:54 2013, 美东)
: A question I encountered during the interview. Could anyone give me some
: idea.
: The key issue is I was asked to modify line 500, which is the function
: declaration...
: Is there a different way to write line 500 which preserves the same
: effective prototype? If so, what is it?

avatar
n*x
8
那么多有收入的PHD
avatar
b*9
9
你让他们广大护士情何以堪啊
lol

【在 l****u 的大作中提到】
: 去EBIZ, 那里全是神医.
avatar
o*d
10
ids是局部变量 在栈空间中
函数返回就没了
可以用malloc来动态分配这个数组

【在 f********1 的大作中提到】
: 【 以下文字转载自 Programming 讨论区 】
: 发信人: falcon8241 (falcon), 信区: Programming
: 标 题: A weird C programming language--Return a pointer to array
: 发信站: BBS 未名空间站 (Wed May 29 13:54:54 2013, 美东)
: A question I encountered during the interview. Could anyone give me some
: idea.
: The key issue is I was asked to modify line 500, which is the function
: declaration...
: Is there a different way to write line 500 which preserves the same
: effective prototype? If so, what is it?

avatar
m*2
11
可以申请学生卡,攒信用。

【在 r******e 的大作中提到】
: 给学生发信用卡邀请
: 是白发,申请只能被reject。 因为学生无收入。 除非乱填收入。 但被查出来就不值了
: 。 这个讲法对否?
: ★ 发自iPhone App: ChineseWeb 1.0.1
: ★ 发自iPhone App: ChineseWeb 1.0.1

avatar
c*d
12
人家不是问哪有神医 哈哈

去EBIZ, 那里全是神医.

【在 l****u 的大作中提到】
: 去EBIZ, 那里全是神医.
avatar
f*1
13
Sorry cannot type Chinese here.
I understand this function is wrong and the question asks about how to
correct it on line 500 while maintaining the same effective prototype.
My previous solution is to modify line 502 using static variable, but the
interviewer said it's incorrect...
avatar
r*1
14
上大学一年级开始就收到各种信用卡邀请,第一张信用卡信用额度500块
avatar
b*9
15
针对“全是”一词

【在 c**********d 的大作中提到】
: 人家不是问哪有神医 哈哈
:
: 去EBIZ, 那里全是神医.

avatar
H*r
16
Unique pointer?

★ 发自iPhone App: ChineseWeb 7.7

【在 f********1 的大作中提到】
: Sorry cannot type Chinese here.
: I understand this function is wrong and the question asks about how to
: correct it on line 500 while maintaining the same effective prototype.
: My previous solution is to modify line 502 using static variable, but the
: interviewer said it's incorrect...

avatar
i*4
17
出门左转去EBIZ,那里很多神医.
avatar
c*9
18
Just change return type to integer array. int[]? which will return a copy
not a pointer.

【在 f********1 的大作中提到】
: Sorry cannot type Chinese here.
: I understand this function is wrong and the question asks about how to
: correct it on line 500 while maintaining the same effective prototype.
: My previous solution is to modify line 502 using static variable, but the
: interviewer said it's incorrect...

avatar
s*a
19
你不就是?

【在 i******4 的大作中提到】
: 出门左转去EBIZ,那里很多神医.
avatar
f*1
20
This results in a compiler error:
error: expected identifier or ‘(’ before ‘[’ token

【在 c****9 的大作中提到】
: Just change return type to integer array. int[]? which will return a copy
: not a pointer.

avatar
Y*i
21

还有神护
当然也有打酱油的

【在 l****u 的大作中提到】
: 去EBIZ, 那里全是神医.
avatar
f*1
22
I am not familiar with unique pointer. It seems that means you can only
modify the memory location with one pointer. I don't know how to apply it
here. Could you elaborate?
Also, will function pointer be helpful in anyway?

【在 H****r 的大作中提到】
: Unique pointer?
:
: ★ 发自iPhone App: ChineseWeb 7.7

avatar
b*f
23
分特, 还是没明白!!
能否有大侠给个类似:
苹果,植物类水果,多次花果,具有丰富营养成分,有食疗、辅助治疗功能。
的解释!感激不尽!
avatar
H*r
24
纯C的话只知道用malloc 或者 传入memory地址,unique pointer 是C++而且只适合特
殊情况,只有一个owner好像才行

★ 发自iPhone App: ChineseWeb 7.7

【在 f********1 的大作中提到】
: I am not familiar with unique pointer. It seems that means you can only
: modify the memory location with one pointer. I don't know how to apply it
: here. Could you elaborate?
: Also, will function pointer be helpful in anyway?

avatar
p*u
25
就是ebay上做买卖的卖方啊.是不是啊?
avatar
r*e
26
就是组织一群人(也叫护士)搞deal然后把护士们搞的deal低价收购来然后高价卖出去
的人

【在 b*********f 的大作中提到】
: 谢谢
avatar
n*h
27
都在哪賣.是ebay啊.
avatar
c*r
28
在ebay把低价收来的货高价倒卖出去的是神医。那些帮神医四处扫货挣个辛苦钱的是护士

【在 b*********f 的大作中提到】
: 分特, 还是没明白!!
: 能否有大侠给个类似:
: 苹果,植物类水果,多次花果,具有丰富营养成分,有食疗、辅助治疗功能。
: 的解释!感激不尽!

avatar
r*e
29
ebay, craigslist, local, 都可以啊

【在 n******h 的大作中提到】
: 都在哪賣.是ebay啊.
avatar
j*4
30
為什麼要叫神醫

护士

【在 c********r 的大作中提到】
: 在ebay把低价收来的货高价倒卖出去的是神医。那些帮神医四处扫货挣个辛苦钱的是护士
avatar
A*9
31
其实我一直不解的是为什么要叫神医和护士,怎么不叫别的
avatar
c*r
32
他们管ebay叫恶霸或者医院,在上面买东西的人叫病人,卖东西的就是神医了

【在 A*********9 的大作中提到】
: 其实我一直不解的是为什么要叫神医和护士,怎么不叫别的
avatar
j*i
33
医生开药方,护士管抓药。
但是开甚末药给甚末病人,还是一声说了算。
医生承担风险,但是也抽大头
avatar
i*4
34
神医姐姐,让我跟你混吧。。。

【在 s********a 的大作中提到】
: 你不就是?
avatar
l*u
35
医生护士只是大神小神的区别
avatar
t*8
36
原来是这个意思啊

【在 b*******9 的大作中提到】
: 针对“全是”一词
avatar
s*a
37
那取决于包子喽。。。

【在 i******4 的大作中提到】
: 神医姐姐,让我跟你混吧。。。
avatar
s*a
38
那取决于包子喽。。。

【在 i******4 的大作中提到】
: 神医姐姐,让我跟你混吧。。。
avatar
f*a
39
也小白的问一下 他们找免州税的护士们搞deal可以理解
但为什么连高州税的也要? 不懂@@~~

【在 r****e 的大作中提到】
: 就是组织一群人(也叫护士)搞deal然后把护士们搞的deal低价收购来然后高价卖出去
: 的人

avatar
s*a
40
苍蝇肉也是肉啊

【在 f*****a 的大作中提到】
: 也小白的问一下 他们找免州税的护士们搞deal可以理解
: 但为什么连高州税的也要? 不懂@@~~

avatar
r*e
41
免税州的护士要排期,因为没有足够的名额。

【在 f*****a 的大作中提到】
: 也小白的问一下 他们找免州税的护士们搞deal可以理解
: 但为什么连高州税的也要? 不懂@@~~

avatar
s*l
42
感谢LZ, 问了个我一直想问不敢问的问题!

【在 b*********f 的大作中提到】
: 谢谢
avatar
Q*n
43
省钱版是神医的温床,此版陆续出了不少神医。。。。。。。。。。
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。