The site may not work properly in Internet Explorer 5 & 6. Use IE 7 or Firefox for Best Experience
Posted September 12th, 2007 by Shanks

Shanks asks:
How to read/write bytes from/to a file in C language?
char arr[16];
FILE *fp;
fp=fopen("filename","rb"); // mode can be "rb" for read bytes
and "wb" for write bytes
while(!feof(fp))
{
fread(arr,sizeof(char),strlen(arr),fp); // contents of file are copied
into arr. fwrite has same
syntax.
printf("%s",arr);
}
fclose(fp);

Bookmark/Search this post with:





Delicious
Digg
Reddit
Magnoliacom
Furl
Facebook
Google
Yahoo
Technorati