Click here to Skip to main content
15,913,055 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: FFT Commands or Noise Test Pin
T210213-Dec-09 20:47
T210213-Dec-09 20:47 
QuestionRecursive problem Pin
Haim Nachum13-Dec-09 13:19
Haim Nachum13-Dec-09 13:19 
Hi.

Suppose i have a function that takes an array and its length.
That function should search the entire array for each element and return a result.

example:
<br />
<br />
  int rec(int arr[], int length)<br />
      {<br />
          if(length == 0)<br />
             return 0;<br />
<br />
            //search array for element length - 1;<br />
            searchingarr(arr,length -1);<br />
           <br />
           rec(arr[],length - 1);<br />
      }<br />


Now . i cant use loops(while or for), no static variables. only one function inside the rec and use only recursive. i cant put a sign in the array that points to the end either.

the problem here is that i want that each time im calling "searchingarr" i paste him the length of the array. here, the length is substracted by 1 each time i call rec.
AnswerRe: Recursive problem Pin
Richard Andrew x6413-Dec-09 14:34
professionalRichard Andrew x6413-Dec-09 14:34 
GeneralRe: Recursive problem Pin
Haim Nachum13-Dec-09 14:48
Haim Nachum13-Dec-09 14:48 
GeneralRe: Recursive problem Pin
Richard Andrew x6413-Dec-09 14:51
professionalRichard Andrew x6413-Dec-09 14:51 
GeneralRe: Recursive problem Pin
Haim Nachum13-Dec-09 15:48
Haim Nachum13-Dec-09 15:48 
GeneralRe: Recursive problem Pin
Richard Andrew x6413-Dec-09 15:54
professionalRichard Andrew x6413-Dec-09 15:54 
General[Message Deleted] Pin
Omegaclass13-Dec-09 18:12
Omegaclass13-Dec-09 18:12 
GeneralRe: Recursive problem Pin
Nelek15-Dec-09 20:56
protectorNelek15-Dec-09 20:56 
QuestionHelp with arrays Pin
Chidori-chan13-Dec-09 8:43
Chidori-chan13-Dec-09 8:43 
AnswerOT Pin
Luc Pattyn13-Dec-09 8:58
sitebuilderLuc Pattyn13-Dec-09 8:58 
JokeRe: OT Pin
CPallini13-Dec-09 10:19
mveCPallini13-Dec-09 10:19 
GeneralRe: OT Pin
Luc Pattyn13-Dec-09 10:27
sitebuilderLuc Pattyn13-Dec-09 10:27 
JokeRe: OT Pin
LunaticFringe13-Dec-09 10:33
LunaticFringe13-Dec-09 10:33 
JokeRe: OT Pin
CPallini13-Dec-09 13:21
mveCPallini13-Dec-09 13:21 
GeneralRe: OT Pin
LunaticFringe13-Dec-09 14:42
LunaticFringe13-Dec-09 14:42 
GeneralRe: OT Pin
CPallini13-Dec-09 13:23
mveCPallini13-Dec-09 13:23 
GeneralRe: OT Pin
Luc Pattyn13-Dec-09 14:05
sitebuilderLuc Pattyn13-Dec-09 14:05 
GeneralRe: OT Pin
CPallini13-Dec-09 20:39
mveCPallini13-Dec-09 20:39 
AnswerRe: Help with arrays Pin
LunaticFringe13-Dec-09 9:50
LunaticFringe13-Dec-09 9:50 
GeneralRe: Help with arrays Pin
Chidori-chan13-Dec-09 10:16
Chidori-chan13-Dec-09 10:16 
GeneralRe: Help with arrays Pin
Richard MacCutchan13-Dec-09 10:26
mveRichard MacCutchan13-Dec-09 10:26 
GeneralRe: Help with arrays Pin
LunaticFringe13-Dec-09 10:29
LunaticFringe13-Dec-09 10:29 
QuestionVisual C++ Drag and Drop and get filename and complete path Pin
ilu200713-Dec-09 6:54
ilu200713-Dec-09 6:54 
AnswerRe: Visual C++ Drag and Drop and get filename and complete path Pin
ilu200713-Dec-09 10:29
ilu200713-Dec-09 10:29 

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.