What is wrong with my code?

"Ahmed Han" <[email protected]> Wed, 20 Jun 2007 18:40:52 +0300
Newsgroups gmane.comp.db.mysql.windows
Message-ID <[email protected]>
>
> #define _WIN32_IE        0x0601
>
#define _WIN32_WINNT    0x0501
> #include <cstdlib>
> #include <iostream>
> #include <windows.h>
> #include "mysql\mysql.h"
> using namespace std;
>
> int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR szParam, int
> nFunster)
> {
>     MYSQL *conn, mysql;
>     bool bConnected = FALSE;
>     mysql_init(&mysql);
>

>     conn = mysql_real_connect(&mysql, "db4free.net", "user", "pass",
> "default_db", 0, NULL, 0);
>     if (conn == NULL)
>     {
>         cout << "Error occured while connecting.\n";
>         cout << "Error code   : " << mysql_errno(&mysql) << endl;
>         cout << "Error string : " << mysql_error(&mysql) << endl;
>     }
>     else
>     {
>         bConnected = TRUE;
>         cout << "Connected successfully.\n";
>     }
>
>     if (bConnected) mysql_close(&mysql);
>
>     system("\nPAUSE");
>     return EXIT_SUCCESS;
> }
>


When I compile and run the code below, I get an error message like this :

> File 'c:\mysql\\share\charsets\?.conf' not found (Errcode: 2)
> Character set '#33' is not a compiled character set and is not specified
> in the
> 'c:\mysql\\share\charsets\Index' file
> Error occured while connecting.
> Error code   : 1251
> Error string : Client does not support authentication protocol requested
> by serv
> er; consider upgrading MySQL client
> Press any key to continue . . .
>

Notice the double backslashes in the path strings "c:\mysql\\share\charse...".
Is that normal?
I looked for sample codes by using Google, and all the example codes I found
are similar to mine.
Maybe one small difference is the use of mysql_init(); function. In some
examples it is used in this way :
mysql = mysql_init(NULL);
Bu I don't think it is what causing the problem.

What should I do to get rid of this problem?
Am I doing something wrong?