title: Passing a NSInteger to a size_t and a NSInteger* to a size_t*
body: <p>My C++ knowledge stinks. I have a code provided by Apple where they, as usually, provided an incomplete solution.</p>
  
  <p>On this code they provide two empty methods headers:</p>
  
  <pre><code>- (NSString *)encodeBase64:(const uint8_t *)input length:(NSInteger)length
  - (NSString *)decodeBase64:(NSString *)input length:(NSInteger *)length
  </code></pre>
  
  <p>These methods, in theory, should call two C++ style functions, but as my C++ knowledge stinks infinity squared plus one, please fill the ???</p>
  
  <pre><code>- (NSString *)encodeBase64:(const uint8_t *)input length:(NSInteger)length
  {
     // I need to call base64_encode and return its results as string... is this correct?
  
     return [NSString stringWithUTF8String:
         base64_encode(input, ???)];
      // ??? I need to pass a NSInteger to a size_t... how do I do that?
  }
  
  
  - (NSString *)decodeBase64:(NSString *)input length:(NSInteger *)length
  {
  
  // ??? = this method receives a NSInteger *length variable. How do I pass that
  // to a size_t * variable required by base64_decode?
  
      NSString *st = [[NSString alloc] initWithBytes:
                      base64_decode([input UTF8String], ???)
                                              length:&amp;length
                                            encoding: NSUTF8StringEncoding];
  
      return st;
  }
  </code></pre>
  
  <p>these 2 methods call these C++ functions</p>
  
  <pre><code>char* base64_encode(const void* buf, size_t size)
  {
     // bla bla bla
  }
  
  void* base64_decode(const char* s, size_t* data_len_ptr)
  {
      // bla bla bla
  }
  </code></pre>
  
  <p>thanks.</p>