由买买提看人间百态

topics

全部话题 - 话题: reorderids
(共0页)
i***0
发帖数: 8469
1
Line in file Contents
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 }
1. Is GetSomeIDs() a reasonable function?
2. Is there a different way to write line 500 which preserves the same
effective prototype? If so
P*******b
发帖数: 1001
2
来自主题: JobHunting版 - 一道C面试题,谁试试
【 以下文字转载自 Programming 讨论区 】
发信人: snowyrose (好好学习天天向上), 信区: Programming
标 题: [合集] C coding problems
发信站: BBS 未名空间站 (Mon Mar 1 13:56:18 2010, 美东)
☆─────────────────────────────────────☆
merriam (爱我所爱,珍惜拥有!) 于 (Sun Jan 3 16:02:31 2010, 美东) 提到:
what the correct int * GetSomeIDs() should be like? Thanks
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’ an
a******u
发帖数: 239
3
来自主题: JobHunting版 - c interview question
I think my answers to Question 7 and 8 are correct, but they said they are
not correct, why?
I already tested the code by Visual C++ (c compiler).
Thank you very much.
Line in file Contents
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-5... 阅读全帖
f********1
发帖数: 228
4
【 以下文字转载自 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,... 阅读全帖
s*******e
发帖数: 664
5
来自主题: Programming版 - [合集] C coding problems
☆─────────────────────────────────────☆
merriam (爱我所爱,珍惜拥有!) 于 (Sun Jan 3 16:02:31 2010, 美东) 提到:
what the correct int * GetSomeIDs() should be like? Thanks
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
f********1
发帖数: 228
6
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 /*--------... 阅读全帖
(共0页)