Click here to Skip to main content
16,005,037 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionreturn multiple values from fuction faulse Pin
Immunity1819-May-07 8:54
Immunity1819-May-07 8:54 
AnswerRe: return multiple values from fuction faulse Pin
Star0919-May-07 9:25
Star0919-May-07 9:25 
GeneralRe: return multiple values from fuction faulse Pin
Immunity1819-May-07 9:27
Immunity1819-May-07 9:27 
GeneralRe: return multiple values from fuction faulse Pin
Star0919-May-07 9:48
Star0919-May-07 9:48 
GeneralRe: return multiple values from fuction faulse Pin
CPallini19-May-07 9:53
mveCPallini19-May-07 9:53 
GeneralRe: return multiple values from fuction faulse Pin
Immunity1819-May-07 10:02
Immunity1819-May-07 10:02 
GeneralRe: return multiple values from fuction faulse Pin
Immunity1819-May-07 10:09
Immunity1819-May-07 10:09 
GeneralRe: return multiple values from fuction faulse Pin
CPallini19-May-07 11:06
mveCPallini19-May-07 11:06 
Immunity18 wrote:
is there a way to not use pointers?

Oh yes, and it simple: write two functions!


Immunity18 wrote:
or if its nessesary can u tell me how i have to write the void find_array { } fuction ?

I will show how to use a pointer as out parameter (I don't want to build the whole exercise for you...Smile | :) ).
In the following code snippet, the mySqr function accepts an int as [IN] argument and returns, via a pointer, the square of that value:

void mySqr(int x, int *px2)
{
  /*
   px2 contains the address of an int
   *px2 is the int itself
  */
  
  *px2 = x * x;
  return;
}

int main()
{
   int i;
   int iSquared;
   
   i=5;
   mySqr(i, &iSquared);

   printf("value=%d, squared value=%d\n", i, iSquared);
}


Hope that helps

Big Grin | :-D

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

GeneralRe: return multiple values from fuction faulse [modified] Pin
Immunity1819-May-07 11:09
Immunity1819-May-07 11:09 
GeneralRe: return multiple values from fuction faulse Pin
David Crow21-May-07 4:06
David Crow21-May-07 4:06 
AnswerRe: return multiple values from fuction faulse Pin
Michael Dunn19-May-07 11:25
sitebuilderMichael Dunn19-May-07 11:25 
GeneralRe: return multiple values from fuction faulse Pin
Immunity1819-May-07 11:27
Immunity1819-May-07 11:27 
GeneralRe: return multiple values from fuction faulse Pin
Christian Graus19-May-07 12:25
protectorChristian Graus19-May-07 12:25 
AnswerRe: return multiple values from fuction faulse Pin
Bram van Kampen20-May-07 6:05
Bram van Kampen20-May-07 6:05 
AnswerRe: return multiple values from fuction faulse Pin
Nemanja Trifunovic20-May-07 8:22
Nemanja Trifunovic20-May-07 8:22 
QuestionEndTask Pin
nofearxd19-May-07 8:43
nofearxd19-May-07 8:43 
AnswerRe: EndTask Pin
CPallini19-May-07 10:04
mveCPallini19-May-07 10:04 
GeneralRe: EndTask Pin
nofearxd19-May-07 10:59
nofearxd19-May-07 10:59 
QuestionRe: EndTask Pin
CPallini19-May-07 11:09
mveCPallini19-May-07 11:09 
QuestionTreeCtrl Pointer Pin
Star0919-May-07 8:07
Star0919-May-07 8:07 
AnswerRe: TreeCtrl Pointer Pin
led mike19-May-07 8:44
led mike19-May-07 8:44 
QuestionRe: TreeCtrl Pointer [modified] Pin
Star0919-May-07 8:47
Star0919-May-07 8:47 
AnswerRe: TreeCtrl Pointer Pin
Mark Salsbery19-May-07 13:56
Mark Salsbery19-May-07 13:56 
GeneralRe: TreeCtrl Pointer Pin
Star0919-May-07 14:14
Star0919-May-07 14:14 
Questionunmanaged c++ VS2005 Pin
spin vector19-May-07 7:38
spin vector19-May-07 7:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.