title: C - function inside struct
body: <p>Im trying to assign a function inside a <code>struct</code>, so far I have this code:</p>
  <pre><code>typedef struct client_t client_t, *pno;
  struct client_t
  {
      pid_t pid;
      char password[TAM_MAX]; // -&gt; 50 chars
      pno next;
      
      pno AddClient() 
  
      {
          /* code */
      }
  };
  
  int main()
  {
      client_t client;
  
      // code ..
  
      client.AddClient();
  }
  </code></pre>
  <blockquote>
  <pre><code>**Error**: *client.h:24:2: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘{’ token.*
  </code></pre>
  </blockquote>
  <p>Which is the correct way to do it ?</p>