在wincc7.0中我读取一个文本文档中保存的字符

这是我使用的C脚本
char tem[50];
char *contant;
int txtline=10;
FILE *fp;
fp=fopen("f://file.txt","r");
if (fp==NULL)
   SetTagChar("OutWord","未文件");
 else
{
fgets(tem,txtline,fp);
strcat(contant,tem);
SetTagChar("OutWord",contant);
}
文档保存在F盘file.txt中,每次都失败,返回NULL,请问有什么错误的地方

最佳答案

fp=fopen("f://file.txt","r");
怎么有两个“/”。

提问者对于答案的评价:
非常感谢

原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc192716.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2017年8月15日
下一篇 2017年8月15日

相关推荐