C语言memset函数为什么加了头文件还是报错: 'memest' undefined; assuming extern returning int
程序如下:#include<stdio.h>#include<windows.h>#include<string.h>voidTestWriteFile(){charsz...
程序如下:
#include<stdio.h>
#include<windows.h>
#include< string.h>
void TestWriteFile()
{
char szpath[]="c:\\test.txt";
char szBuffer[0x12];
FILE* pFile=NULL;
int nwrite=0;
//打开文件
pFile=fopen(szpath,"wb");
if(pFile==NULL)
{
printf("文件打开失败!\n");
}
//向文件写入数据
memest(szBuffer,0,sizeof(szBuffer));
strcpy(szBuffer,"china");
nwrite=fwrite(szBuffer,1,strlen(szBuffer),pFile);
if(nwrite==0)
{
printf("文件写入打开失败!\n");
}
//关闭文件
fclose(pFile);
}
void main()
{
TestWriteFile();
} 展开
#include<stdio.h>
#include<windows.h>
#include< string.h>
void TestWriteFile()
{
char szpath[]="c:\\test.txt";
char szBuffer[0x12];
FILE* pFile=NULL;
int nwrite=0;
//打开文件
pFile=fopen(szpath,"wb");
if(pFile==NULL)
{
printf("文件打开失败!\n");
}
//向文件写入数据
memest(szBuffer,0,sizeof(szBuffer));
strcpy(szBuffer,"china");
nwrite=fwrite(szBuffer,1,strlen(szBuffer),pFile);
if(nwrite==0)
{
printf("文件写入打开失败!\n");
}
//关闭文件
fclose(pFile);
}
void main()
{
TestWriteFile();
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询