title: How can I pass a generic struct to a function in C?
body: <p>I'm beginner in C programming and I have a doubt about to pass a generic struct to a function in C.</p>
  
  <p>Here is what I have:</p>
  
  <pre><code>typedef struct {
      char name[20];
      float price;
  } product;
  
  typedef struct {
      char name[20];
      int type;
  } category;
  </code></pre>
  
  <p>And I want to do something like this:</p>
  
  <pre><code>void changeName(struct *s, newName[20]) {
      strcpy(s-&gt;name, newName);
  }
  </code></pre>
  
  <p>If someone has already asked that, please disconsider this and sends me the issue link.</p>
  
  <p>Someone can help me?</p>
  
  <p>Thanks.</p>