Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.87 KB | None | 0 0
  1. // I think i can change this to
  2. //bool recur_func(char letters[], char temparray[], int arrayLen,  int curr_pos, int end_pos)
  3. void recur_func(char letters[], char temparray[], int arrayLen,  int curr_pos, int end_pos)
  4. {
  5.     if(curr_pos==end_pos && strcmp(temparray,"ROFL")==0)
  6.     {
  7.        //if you found what you needed print it out and return to end the funcion
  8.             printf ("%s", temparray);
  9.             return; //function will exit since you already found what you need.
  10.     }
  11.    
  12.         for(int i =0;i<arrayLen; i++)
  13.         {
  14.             //what are you trying to acomplish here? this is weird....
  15.             temparray[curr_pos] = letters[i];
  16.             recur_func(letters,temparray,arrayLen,curr_pos +1, end_pos,);
  17.             /*i think i can change this to
  18.             if (recur_func(letters,temparray,arrayLen,curr_pos +1, end_pos,))
  19.             {
  20.                 return true;
  21.             }
  22.         }
  23.        
  24.    
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement