linux下sprintf_s函数的替代
error code:
char buf[];
sprintf_s(buf, , "predicted position:(%3d, %3d)", predict_pt.x, predict_pt.y);
cv::putText(image, buf, cv::Point(,), CV_FONT_HERSHEY_SCRIPT_COMPLEX, , cv::Scalar(,,), , );
sprintf_s(buf, , "current position :(%3d, %3d)", mousePosition.x, mousePosition.y);
cv::putText(image, buf, cv::Point(,), CV_FONT_HERSHEY_SCRIPT_COMPLEX, , cv::Scalar(,,), , );
error discription:
‘sprintf_s’ was not declared in this scope
sprintf_s(buf, , "predicted position:(%3d, %3d)", predict_pt.x, predict_pt.y);
windows平台下线程安全的格式化字符串函数sprint_s并非标准C函数,因此linux下无法使用,但可以使用snprintf函数代替。
right code:
char buf[];
snprintf(buf, , "predicted position:(%3d, %3d)", predict_pt.x, predict_pt.y);
cv::putText(image, buf, cv::Point(,), CV_FONT_HERSHEY_SCRIPT_COMPLEX, , cv::Scalar(,,), , );
snprintf(buf, , "current position :(%3d, %3d)", mousePosition.x, mousePosition.y);
cv::putText(image, buf, cv::Point(,), CV_FONT_HERSHEY_SCRIPT_COMPLEX, , cv::Scalar(,,), , );
Re:
End
linux下sprintf_s函数的替代的更多相关文章
- linux下sprintf_s函数的替代(转载)
转自:http://www.cnblogs.com/yeahgis/archive/2013/01/22/2872179.html windows平台下线程安全的格式化字符串函数sprint_s并非标 ...
- 对于linux下system()函数的深度理解(整理)
原谅: http://blog.sina.com.cn/s/blog_8043547601017qk0.html 这几天调程序(嵌入式linux),发现程序有时就莫名其妙的死掉,每次都定位在程序中不同 ...
- 转:对于linux下system()函数的深度理解(整理)
这几天调程序(嵌入式linux),发现程序有时就莫名其妙的死掉,每次都定位在程序中不同的system()函数,直接在shell下输入system()函数中调用的命令也都一切正常.就没理这个bug,以为 ...
- 【C/C++】Linux下system()函数引发的错误
http://my.oschina.net/renhc/blog/54582 [C/C++]Linux下system()函数引发的错误 恋恋美食 恋恋美食 发布时间: 2012/04/21 11:3 ...
- (笔记)Linux下system()函数的深度理解(整理)
注:从其它地方转的非常好的一篇文章,值得深究! 这几天调程序(嵌入式linux),发现程序有时就莫名其妙的死掉,每次都定位在程序中不同的system()函数,直接在shell下输入system()函数 ...
- linux下syscall函数,SYS_gettid,SYS_tgkill
出处:http://blog.chinaunix.net/uid-28458801-id-4630215.html linux下syscall函数,SYS_gettid,SYS_tgkill ...
- Linux下c函数dlopen实现加载动态库so文件代码举例
dlopen()是一个强大的库函数.该函数将打开一个新库,并把它装入内存.该函数主要用来加载库中的符号,这些符号在编译的时候是不知道的.这种机制使得在系统中添加或者删除一个模块时,都不需要重新编译了. ...
- [转帖]Linux下fork函数及pthread函数的总结
Linux下fork函数及pthread函数的总结 https://blog.csdn.net/wangdd_199326/article/details/76180514 fork Linux多进程 ...
- [Android Memory] Linux下malloc函数和OOM Killer
http://www.linuxidc.com/Linux/2010-09/28364.htm Linux下malloc函数主要用来在用户空间从heap申请内存,申请成功返回指向所分配内存的指针,申请 ...
随机推荐
- python pstats ,profile 性能分析
#! /usr/bin/env python # encoding=utf8 import pstats import profile def func1(): for i in range(1000 ...
- API接口自动化之2 处理http请求的返回体,对返回体做校验
举例一个接口测试的常见流程 1) 发送接口请求2) 断言接口响应状态是不是200 OK3) 断言接口的响应时间低于某一个值(看情况,不是必选)4) 断言响应数据是否正确,一般的做法是判断某一个值是否相 ...
- resin中关于url rewrite来传递jsessionid的问题
最近两天在项目中碰到,一个很奇怪的问题.同一个账号多次切换登录时,会出现这个账号的信息在session中找不到,虽然可以登录成功,但是之后这个用户信息好像没有保存到session中一样,或者是被改变了 ...
- BeanShell使用json.jar包处理Json数据
环境准备 ①Jmeter版本 ,JDK ②前置条件:将json.jar包置于..\lib\下, 如果还是报错,可以将该jar包添加到测试计划的Library中:否则会报:Typed variable ...
- Win7 默认.lnk打开方式全是别的程序 还原的办法
Xu言: no zuo no die~ 今天,一个朋友问我,他电脑桌面上点任何东西都是提示下载... - -||| 本以为是中毒了,然后上去看了一眼..发现他自己把所有.lnk 的默认打开方式选择了搜 ...
- ural Ambitious Experiment 树状数组
During several decades, scientists from planet Nibiru are working to create an engine that would all ...
- python-day52--前端html、css
一.html需掌握的: 1. img标签 属性:src alt title width height 2. a标签 属性:href target 3. ul 标签及li 标签,二者都是块级标签 ul ...
- POJ-3083 Children of the Candy Corn (BFS+DFS)
Description The cornfield maze is a popular Halloween treat. Visitors are shown the entrance and mus ...
- Google浏览器设置变更默认搜索引擎为百度
- 72. Edit Distance *HARD*
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2 ...