ARM LINUX上用C写文件的问题
C/C++ code:
char Time="2009-9-23";
FILE *fpOut=fopen("1.txt","w+");
if(fpOut==NULL)
return ;
fwrite(Time,strlen(Time),1,fpOut);
sprintf(fpOut,"%s",Time);
fclose(fpOut);
为什么写的文件为空的呢,在ARM 上 那位知道帮下忙,谢谢了
Time的类型不对
char * Time="2009-9-23";
或者
char Time[] ="2009-9-23";
这是什么用法?
sprintf(fpOut,"%s",Time);
楼主是想用 fprintf 吧。
同楼上
C/C++ code:
char Time[]="2009-9-23";//mark
FILE *fpOut=fopen("1.txt","w+");
if(fpOut==NULL)
return ;
fwrite(Time,1,strlen(Time),fpOut);
fclose(fpOut);
楼主太马虎了
是的
修改
char* Time="2009-9-23";
fprintf(fpOut,"%s",Time);
在ARM 里 没用
那位碰到过吗
相关问答:
问一下:
#include <stdio.h>
int main()
{
char x, y, z;
int i;
int a[16];
for(i=0; i<=16; i++)
{
a[i] = 0;
......
//C 接口
extern "C"
{
TESSDLL_API int __cdecl GetTessText(const char *imagefile, char *text);
}
//我在C#中声明
//调用C DLL 中的函数
[DllImport("OCRapi.dll&quo ......
内容涉及:C、C++、STL、VC++、MFC、COM、ATL、Windows网络编程、数据库编程、Windows驱动编程、软件工程、Windows操作系统编程,等等方面。
下载地址:http://www.cctry.com/forumdisplay.php?fid=46
......
c# 有没有用于C/S的 html文本编辑器
就像web界面的文本内容编辑器
up
C/S还要编译器干嘛啊
又不用控制样式
貌似没有吧 如果有了通知下我 我也要liujintaohfbb@163.com我的邮箱 ......