title: How to set & get value of pointer Swift
body: <p>In Objetive-C when I want set/change value of pointer. I use</p>
  
  <pre><code>*pointer = value
  </code></pre>
  
  <p>But In Swift, how to get/set value of pointer?</p>
  
  <p>I'm woking with bitmap pixel:</p>
  
  <pre><code>  NSUInteger offsetPixelCountForInput = ghostOrigin.y * inputWidth + ghostOrigin.x;
    for (NSUInteger j = 0; j &lt; ghostSize.height; j++) {
      for (NSUInteger i = 0; i &lt; ghostSize.width; i++) {
        UInt32 * inputPixel = inputPixels + j * inputWidth + i + offsetPixelCountForInput;
        UInt32 inputColor = *inputPixel;
  
        newR = MAX(0,MIN(255, newR));
        newG = MAX(0,MIN(255, newG));
        newB = MAX(0,MIN(255, newB));
  
          *inputPixel = RGBAMake(newR, newG, newB, A(inputColor));
      }
    }
  </code></pre>
  
  <p>So I want to convert this code into Swift, but I'm stuck with pointers. </p>
  
  <p><strong>23.03.2016 - Update code</strong></p>
  
  <pre><code>var inputPixels:UnsafeMutablePointer&lt;UInt32&gt; = nil
  inputPixels = UnsafeMutablePointer&lt;UInt32&gt;(calloc(inputHeight * inputWidth, UInt(sizeof(UInt32))))
  </code></pre>