Reputation: 15
connect to MySQL: works fine.
mysql_real_connect(conn, server, user, pass, db, 0, NULL, 0);
I want to do something like
char *status = "";
status = mysql_real_connect(conn, server, user, pass, db, 0, NULL, 0);
printf(stauts);
the above attempt results in compile error:
warning: assignment from incompatible pointer type
Solution is needed.
Upvotes: 0
Views: 78
Reputation: 302
From the MySQL manual mysql_real_connect
returns a MYSQL*
connection handler and thus cannot be stored in a char*
.
Upvotes: 1