title: how to make a function body repeat in c
body: <p>So I am making this program and I am almost done. However, before I finish I need to make a body function repeat n times and print that answer. For example when iterated once, a string of 'duiolkjgvc' goes into this function and then becomes 'fghiwuegfvw'. Or if iterated twice, the 'fghiwuegfvw' will become whatever I coded in that function and so on. </p>
  
  <p>I hope this explanation is clear, if not ask me to clarify. Any help will be appreciated.  </p>
  
  <p>My attempt (its a fairly long code so I will only print what is relevant to this qs): </p>
  
  <hr>
  
  <pre><code>    void printString(String * s, Rules *r);
  
      int main(int argc, char * argv[]){
      ...
         printString(&amp;s1, &amp;r1);
      ....
  }
      return 0;
  
  void printString(String * s, Rules *r){
      if(strcmp(r-&gt;startString,p-&gt;nameReplace)==0){
            strcpy(p-&gt;newString,p-&gt;stringReplace); 
      }
  }
  </code></pre>
  
  <p>so essentially, i need to repeat the function body called printString n times</p>