title: Swift use c struct
body: <p>Sorry for the title, I can't find words to describe my question in few words.</p>
  
  <p>I already know that swift can use struct written in c. For example</p>
  
  <p>In Bridging-Header.h
  </p>
  
  <pre><code>typedef struct {
      int x;
      int y;
  } Pointer;
  </code></pre>
  
  <p>then I can use Pointer directly.</p>
  
  <p>But in my case, I have a library written in C. There are many structs with hidden implement. For example:<br>
  In Briding-Header.h</p>
  
  <pre><code>typedef struct Pointer Pointer;
  </code></pre>
  
  <p>I can't use Pointer any more, got unknown type. In my library Pointer is used as</p>
  
  <pre><code>create_pointer(Pointer **pointer);
  </code></pre>
  
  <p>Any help is appreciated!</p>
  
  <p>P.S I have no .h file which define struct Pointer. All details about Pointer is hide, access them by function, for example</p>
  
  <pre><code>int getx(Pointer *pointer);
  </code></pre>
  
  <p>Here is my full test code:<br>
  user_input.c</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  #include "user_input.h"
  
  struct Pointer {
      int x;
      int y;
  };
  
  void get_user_input(int *user_input) {
      scanf("%i", user_input);
  }
  
  void init_pointer(Pointer *point) {
      point-&gt;x = 20;
      point-&gt;y = 20;
  }
  </code></pre>
  
  <p>user_input.h</p>
  
  <pre><code>#ifndef __user_input_h__
  #define __user_input_h__
  
  typedef struct Pointer Pointer;
  
  void init_pointer(Pointer *p);
  
  #endif
  </code></pre>
  
  <p>Bridging-Header.h</p>
  
  <pre><code>#include "user_input.h"
  </code></pre>
  
  <p>main.swift</p>
  
  <pre><code>import Foundation
  var pointer:Pointer = Pointer(x:10, y:20)
  </code></pre>
  
  <p>Xcode give me this error: Pointer undefined</p>