#include<stdio.h>
int main(void)
{
FILE *fp;
char *buffer="abc";
char read_Buffer;
if((fp = fopen("abc.txt","w+"))==NULL)
{
printf("can't open abc.txt\n");
exit(0);
}
if(fwrite(buffer,sizeof(char),3,fp)!=3)
printf("can't write abc.txt\n");
fseek(fp,1,0);
if(fread(&read_Buffer,sizeof(char),1,fp)!=1)
printf("can't read abc.txt\n") ;
printf("%c\n",read_Buffer);
return 0;
}
int main(void)
{
FILE *fp;
char *buffer="abc";
char read_Buffer;
if((fp = fopen("abc.txt","w+"))==NULL)
{
printf("can't open abc.txt\n");
exit(0);
}
if(fwrite(buffer,sizeof(char),3,fp)!=3)
printf("can't write abc.txt\n");
fseek(fp,1,0);
if(fread(&read_Buffer,sizeof(char),1,fp)!=1)
printf("can't read abc.txt\n") ;
printf("%c\n",read_Buffer);
return 0;
}