C-Mysql-警告 : assignment from incompatible pointer type

标签 c

连接到 MySQL:工作正常。

mysql_real_connect(conn, server, user, pass, db, 0, NULL, 0);

我想做类似的事情

char *status = "";
status = mysql_real_connect(conn, server, user, pass, db, 0, NULL, 0);
printf(stauts);

上述尝试会导致编译错误:

warning: assignment from incompatible pointer type

需要解决方案。

最佳答案

来自MySQL manual mysql_real_connect 返回 MYSQL* 连接处理程序,因此不能存储在 char* 中。

关于C-Mysql-警告 : assignment from incompatible pointer type,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44468668/

相关文章:

c - AVR 工作室 Nibobee 图书馆

c - 如何将多个字符值存储在单个整数变量中?

复杂的通用堆栈

c - OpenGL 无法使用 Visual C++ 编译器渲染场景

c - 用c构建堆栈的问题

c - 使用 MPLAB 编译器解析以逗号分隔的字符串?

c - C 中使用数组的大整数

c - 在 C 中运行客户端和服务器套接字连接 - 使用线程

c - 让函数更改指针在 C 中表示的值

c - C 中用于排序 time_t 对象的动态数据结构?