);
需要包含的头文件:stdio.h
注意:
sprintf_s()是sprintf()的安全版本,通过指定缓冲区长度来避免sprintf()存在的溢出风险
程序示例:
char filename[1024];//需要预先分配缓冲区char path1[128] = "D:\\Program\\Tesseract-OCR\\tesseract.exe";char path2[128] = "D:\\Program\\Tesseract-OCR\\";char path3[128] = "D:\\Program\\Tesseract-OCR\\txt";char path4[128] = "-l chi_sim";sprintf_s(filename,"%s %s %s %s",path1,filepath,path3,path4);system(filename);
http://blog.csdn.net/tigernana/article/details/6916491