您的位置:首页 > 其它

扫描枪程序-扫描枪扫码,保存数据并在当前目录生成文档

2017-04-26 16:56 363 查看
琢磨半天,原来就这么简单。

等待扫描枪扫码,保存数据并在当前目录生成文档

 // scan.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#pragma warning(disable:4996)
#include "string.h"
#include "stdlib.h"
int main()
{
char pchData[_MAX_PATH];
//char str[_MAX_PATH];
printf("Waiting for the scan data:");
scanf("%s", pchData);

//printf("%s", pchData);

FILE *pFile = fopen("scan.txt", "w+t");
if (pFile)
{

fwrite(pchData, sizeof(char), strlen(pchData), pFile);
fclose(pFile);
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐