由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 请教一个问题,发两个包子。
相关主题
array of pointers to functions[Algo] k numbers in array of n numbers sum to T
A weird C programming language--Return a pointer to array (array contains two integer that sum up to 7
Extension problem of finding intersection of two sorted array[emc/greenplum面试]senior engineer
c interview question问求array中3个数和最接近k的解法
Interview Question今天计划做20题
问个Array Puzzle题在电脑上直接写程序
一个c++ 题目彭博 面试题
Facebook Phone interviewreverse an array
相关话题的讨论汇总
话题: getsomeids话题: aliasid话题: array话题: function话题: pointers
进入JobHunting版参与讨论
1 (共1页)
a**1
发帖数: 213
1
只有两个包子了现在。
问题好像被问了很多次了,但没查到答案。谢谢。
这个思路对吗:
int* GetSomeIDs(aliasID*** p_aliasID_io)
怎么用GetNextAlias()? 这个问题说的太不清楚了。
题目是:
Correct the problems with GetSomeIDs(), and add some additional
functionality to it, as follows. A single new version of the function
should be provided.
The new version should:
a) Maintain the same "int *" return type which returns a pointer to fixed
sized array of ints.
b) IN ADDITION to its regular function return, provide to its calling
functions a usable array of poin
x***y
发帖数: 633
2
There is something unclear about the problem, but I think one possibility is:
Before calling the GetSomeIDs() function, the length of the array of aliasID
pointers is determined and a pointer is passed as a parameter to the
GetSomeIDs() function: ( we can cast p from void * to aliasID** inside the
function)
int* GetSomeIDs(void * p)
Inside this function, we can call int GetNumberOfAliases(void) to get # of
pointers in the array and dynamically allocate memory which will be assigned to each point

【在 a**1 的大作中提到】
: 只有两个包子了现在。
: 问题好像被问了很多次了,但没查到答案。谢谢。
: 这个思路对吗:
: int* GetSomeIDs(aliasID*** p_aliasID_io)
: 怎么用GetNextAlias()? 这个问题说的太不清楚了。
: 题目是:
: Correct the problems with GetSomeIDs(), and add some additional
: functionality to it, as follows. A single new version of the function
: should be provided.
: The new version should:

a**1
发帖数: 213
3
atu1,您好:
您转给 xnxky,现金(伪币):10,收取手续费:0.1
同时附加了如下留言给 xnxky.
thanks
站务
a**1
发帖数: 213
4
That will be too complicated compared to other questions.
What I am thinking is there is a collection of aliasIDs already there. Then
generate an array of pointers pointing to those aliasIDs. But there is still
something wrong here.

is:
aliasID
assigned to each pointer in the array(we get the address of these pointers
through void * parameter).
GetNextAlias will return the next available pointer or NULL.

【在 x***y 的大作中提到】
: There is something unclear about the problem, but I think one possibility is:
: Before calling the GetSomeIDs() function, the length of the array of aliasID
: pointers is determined and a pointer is passed as a parameter to the
: GetSomeIDs() function: ( we can cast p from void * to aliasID** inside the
: function)
: int* GetSomeIDs(void * p)
: Inside this function, we can call int GetNumberOfAliases(void) to get # of
: pointers in the array and dynamically allocate memory which will be assigned to each point

x***y
发帖数: 633
5
Yes, it's also possible that in the function GetSomeIDS, we assign the array
of pointers some already existing aliasIDS structure, and when exiting from
this function, the call to GetNextAliss will get the next pointer to
aliasID in the array. We can use this method(calling GetSomeIDS and aliasID
iteratively to get all the IDS.) I'm not sure what else are expected....

Then
still

【在 a**1 的大作中提到】
: That will be too complicated compared to other questions.
: What I am thinking is there is a collection of aliasIDs already there. Then
: generate an array of pointers pointing to those aliasIDs. But there is still
: something wrong here.
:
: is:
: aliasID
: assigned to each pointer in the array(we get the address of these pointers
: through void * parameter).
: GetNextAlias will return the next available pointer or NULL.

a**1
发帖数: 213
6
包子还有
1 (共1页)
进入JobHunting版参与讨论
相关主题
reverse an arrayInterview Question
这题哪错了?问个Array Puzzle题
想成为嵌入式程序员应知道的0x10个基本问题 zz一个c++ 题目
问大家一个cpp中function pointer的问题Facebook Phone interview
array of pointers to functions[Algo] k numbers in array of n numbers sum to T
A weird C programming language--Return a pointer to array (array contains two integer that sum up to 7
Extension problem of finding intersection of two sorted array[emc/greenplum面试]senior engineer
c interview question问求array中3个数和最接近k的解法
相关话题的讨论汇总
话题: getsomeids话题: aliasid话题: array话题: function话题: pointers