   Writing Out Contents of Memory
  I'm trying to write out the contents of memory to a text file.  FILE *MyFile = NULL;unsigned char MyBuffer[MAX_READ + 1];MyFile = fopen("C:\\MyDocs\\MyFile.txt", "w+b");for(int x = 0; x < MAX_READ; x++){MyBuffer[x] = GetOneByteFromMemLoc(x + MEM_LOC_OFF_SET);}fputs((char *)MyBuffer,MyFile);fclose(MyFile);--------This code works fine when the memory block is filled with dummy data like the alphabet or a Frank Herbert novel.  However, the code does not work when the memory block has live raw data.  I think the problem is there exists an empty byte in the memory block and the "fputs" interprets it as a NULL terminator.  I think I'm taking the wrong approach to writing out data from memory.  Could someone steer me in the right direction?  Thanks. 
  yep, 0 will terminate the C string and stop the fputs.try looping the buffer and puting char by char with fputc.;  Did you try to fwrite the MAX_READ + 1 bytes to the file?   ;  Funny you should say that.  I was just about to do what you suggested, Doc.   ;  What is MEM_LOC_OFF_SET? It appears to be already some kind of pointer into memory. Why not just use that location directly for the write call, instead of copying everything into a buffer first? (Hint: fwrite() takes a length parameter. Well, two, actually - an "element size" and an "element count".)   