MySql 安装使用及C++连接字符串
摘要:参考: 1. MySQL函数 - 逆心 - 博客园 http://www.cnblogs.com/kissdodog/p/4168721.html 2.MySQL - Data too long for column 'uid' at row 1 Query: - J.L.Lee - 博客园 htt
阅读全文
posted @
2018-01-26 11:22
南枝
阅读(360)
推荐(0) 编辑
string、 int、byte、十六进制的转换
摘要:做上下位机通信的项目,关于发送数据格式的一些转换,记录一下。 一、两个函数 主要用到两个函数: 1. strtol 将数字字符串按照指定格式转换成数字 std::string strInformation = “12”; BYTE data = (BYTE)strtol(strInformation
阅读全文
posted @
2018-01-12 15:02
南枝
阅读(781)
推荐(0) 编辑
数组
摘要:一、数组的两个特殊性质 (1)不允许拷贝和赋值 不能将数组的内容拷贝给其他数组作为其初始值,也不能用数组为其他数组赋值。 数组的拷贝可以使用memcpy()函数: int des[5], src[3] memcpy(des, src, sizeof(src)); (2)使用数组是通常将其转化成指针
阅读全文
posted @
2018-01-12 14:13
南枝
阅读(223)
推荐(0) 编辑
关于time的一些操作
摘要:0. C/C++获取系统时间戳,精确到毫秒 另一种方法获取系统当前时间戳, 单位为秒 #include <time.h> time_t now; time(&now); //获取time_t类型的当前时间 ,单位为秒 int unixTime = (int)time(&now); char buf[
阅读全文
posted @
2018-01-10 16:53
南枝
阅读(453)
推荐(0) 编辑