title: Handling Functions and Pointers
body: <p>I'm not a C programmer but I need to get a simple POC for one of our applications that can be extended with C. I've got the code compiling by passing data straight through my module and my idea is to pass out the reverse of the character string passed in to prove my code has actually done something to the data.</p>
  
  <p>I currently have this code to pass each input straight to the output:</p>
  
  <pre><code>INFA_CTSetData(outputGroupPorts[i], 
      INFA_CTGetDataStringM(inputGroupPorts[i]));
  </code></pre>
  
  <p>The <code>INFA_CTGetDataStringM</code>function is defined as:</p>
  
  <pre><code>char* INFA_CTGetDataStringM(INFA_CT_INPUTPORT_HANDLE dataHandle);
  </code></pre>
  
  <p>I have found a function to reverse a string <a href="http://cboard.cprogramming.com/c-programming/49938-strrev.html" rel="nofollow">here</a></p>
  
  <pre><code>char *mystrrev(char *s)
  {
     char *start = s, *t = strchr(s, '\0'); /* point to end of string */
     /*
      * Swap the values at the beginning (pointed to by 's') and the end
      * (pointed to by 't'); 's' and 't' meet in the middle.
      */
     for ( --t/* skip terminating null character */; s &lt; t; ++s, --t )
     {
        /* Just your run-of-the-mill swap here. */
        char temp = *s;
        *s = *t;
        *t = temp;
     }
     return start;
  }
  </code></pre>
  
  <p>What I'm failing to do is pass the result of the call to <code>INFA_CTGetDataStringM</code> through <code>mystrrev</code> and on to <code>INFA_CTSetData</code>.</p>
  
  <pre><code>INFA_CTSetData(outputGroupPorts[i],
      mystrrev(INFA_CTGetDataStringM(inputGroupPorts[i])));
  </code></pre>
  
  <p>produces these errors at compilation</p>
  
  <pre><code>p_Reverse.c:155: error: conflicting types for 'mystrrev'
  p_Reverse.c:145: error: previous implicit declaration of 'mystrrev' was here
  </code></pre>
  
  <p>Years if Visual Basic and C# have made my life too easy - can some one help me get this code working? I've blindly tried adding <code>*</code> and <code>&amp;</code> to get different compiler errors - and now I'm stumped.</p>