yeah, in my actual code i do check to make sure fopen worked thanks for the pointer though. Its been a while since i used C and im just testing ideas at the moment to get back into it, but as a second questions. If i input the following code
Code:
char x[10]="ABCDEFGHIJ";
FILE *fp;
if((fp=fopen("c:\\test.bin", "wb"))==NULL)
{
printf("Couldnot open file");
exit(1);
}
fwrite(x, sizeof(x[0]), sizeof(x)/sizeof(x[0]), fp);
fcloseall();
return(0);
should the file test.bin contain the binary version of ABCDEFGHIJ or should it show ABCDEFGHIJ if opened in notepad?