title: Getting Cocoa function from C++
body: <p>In the answer to this question: <a href="https://stackoverflow.com/questions/17599086/how-to-get-currently-logged-in-username">get logged in user</a> the accepted answer uses Delphi code that looks like this to get access to the Cocoa function NSUserName.</p>
  
  <pre><code>function NSUserName: Pointer; cdecl; external '/System/Library/Frameworks/Foundation.framework/Foundation' name _PU +'NSUserName';
  </code></pre>
  
  <p>How would you do this in C++Builder?</p>