C++
weixin_43271225
这个作者很懒,什么都没留下…
展开
-
json exception type_error 305 cannot use operator() with a string argument with string
我在使用https://github.com/nlohmann/json#json-as-first-class-data-type这个C++ JSON库时出现了如标题所示的错误。检查发现是因为我先定义了nlohmann::json j然后赋值,比如j[“data”] = “abc”然后我在没有j.clear()的情况下就又一次赋值j[“data”][“type”] = "someType"这样了...原创 2020-11-07 17:26:27 · 3155 阅读 · 0 评论 -
mysql_real_connect失败
几个月前我是这样用的mysql_real_connect(&mysql, “localhost”, “root”, “123456”, “db1”, 0, NULL, 0)但不知道这几个月我修改了什么东西那样用不行了,现在得这样mysql_real_connect(&mysql, “127.0.0.1”, “root”, “123456”, “db1”, 0, NULL, 0)...原创 2020-09-26 14:25:14 · 1358 阅读 · 0 评论 -
c++ 字符串替换指定字符
这个例子把string字符串中的 " 替换成"原作者Michael Mrozek ,在stackoverflow找到的https://stackoverflow.com/questions/3418231/replace-part-of-a-string-with-another-string#include <iostream>using namespace std;#include <string>#include<string.h>#include "j转载 2020-09-06 17:03:15 · 4449 阅读 · 1 评论