title: Steamworks checking if a user is logged in
body: <p>So the code that I've been using to get a user's Steam ID is:</p>
  
  <pre><code>CSteamID uid = SteamUser()-&gt;GetSteamID();
  uint64 pid = uid.ConvertToUint64();
  std::ostringstream sin;
  sin &lt;&lt; pid;
  std::string s = sin.str();
  return s.c_str();
  </code></pre>
  
  <p>This works just fine, but when a user is not logged into Steam, this crashes.</p>
  
  <blockquote>
    <p>Access violation - code c0000005 (first/second chance not available)</p>
  </blockquote>
  
  <hr>
  
  <p>Does Steam provide a function that I can use to check if the user is logged in before running code that depends on the user being logged in? Or is there some sort of try/catch block I can use here to make sure that this does not break and return false if the user is not logged in?</p>