title: Cast a Swift struct to UnsafeMutablePointer<Void>
body: <p>Is there a way to cast a Swift struct's address to a void UnsafeMutablePointer?<br>
  I tried this without success:  </p>
  
  <pre><code>struct TheStruct {
      var a:Int = 0
  }
  
  var myStruct = TheStruct()
  var address = UnsafeMutablePointer&lt;Void&gt;(&amp;myStruct)
  </code></pre>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT: the context</strong><br>
  I am actually trying to port to Swift the first example in <em>Learning CoreAudio</em>.<br>
  This is what I have done until now:  </p>
  
  <pre><code>func myAQInputCallback(inUserData:UnsafeMutablePointer&lt;Void&gt;,
      inQueue:AudioQueueRef,
      inBuffer:AudioQueueBufferRef,
      inStartTime:UnsafePointer&lt;AudioTimeStamp&gt;,
      inNumPackets:UInt32,
      inPacketDesc:UnsafePointer&lt;AudioStreamPacketDescription&gt;)
   { }
  
  struct MyRecorder {
      var recordFile:     AudioFileID = AudioFileID()
      var recordPacket:   Int64       = 0
      var running:        Boolean     = 0
  }
  
  var queue:AudioQueueRef = AudioQueueRef()
  AudioQueueNewInput(&amp;asbd,
      myAQInputCallback,
      &amp;recorder,  // &lt;- this is where I *think* a void pointer is demanded
      nil,
      nil,
      UInt32(0),
      &amp;queue)
  </code></pre>
  
  <p>I am doing efforts to stay in Swift, but if this turns out to be more a problem than an advantage, I will end up linking to a C function.  </p>
  
  <p><strong>EDIT: bottome line</strong><br>
  If you came to this question because you are trying to use a CoreAudio's AudioQueue in Swift... don't. (read the comments for details)   </p>