title: MySQL C++ Connector getting a string with SELECT query
body: <p>I'm new to mysql on c++, did it before on PAWN, worked great, but now I have a problem. I'm trying to get a password from mysql database, gonna do the rest of the code later and I'm getting a hex code? if that's right? Here's an example of what I'm getting: 0x59fcb0. It allways changes when I restart the program/recompile it. I tried to google for my problem, but didn't get anything close. So the only thing I want to do, Is to get a value of a field and store it as a variable... Here's my code:</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  
  #include &lt;windows.h&gt;
  #include &lt;mysql/mysql.h&gt;
  
  using namespace std;
  
  static char *opt_host_name = "host"; /* HOST */
  static char *opt_user_name = "user"; /* USERNAME */
  static char *opt_password = "pass"; /* PASSWORD */
  static unsigned int opt_port_num = 3306; /* PORT */
  static char *opt_socket_name = NULL; /* SOCKET NAME, DO NOT CHANGE */
  static char *opt_db_name = "database name"; /* DATABASE NAME */
  static unsigned int opt_flags = 0; /* CONNECTION FLAGS, DO NOT CHANGE */
  
  int main ()
  {
      MYSQL *conn; /* pointer to connection handler */
      MYSQL_RES *res; /* holds the result set */
      MYSQL_ROW row;
  
      /* INITIALIZE CONNECTION HANDLER, DO NOT CHANGE */
      conn = mysql_init (NULL);
  
      /* THIS CONNECTS TO SERVER, DO NOT CHANGE ANYTHING HERE */
      mysql_real_connect (conn, opt_host_name, opt_user_name, opt_password,
      opt_db_name, opt_port_num, opt_socket_name, opt_flags);
      /* show tables in the database (test for errors also) */
      mysql_query(conn, "SELECT Password FROM Users WHERE Name = 'MY_NICKNAME'");
      res = mysql_store_result(conn);
      cout &lt;&lt; "Password is: \n";
      cout &lt;&lt; res &lt;&lt; endl;
  
      /* disconnect from server */
      mysql_close (conn);
  
      system("pause");
      return 0;
  } 
  /* end main function */
  </code></pre>
  
  <p>Also, I have changed the mysql database connection options.</p>