Ya, your plan sounds good to me. That is, all except your file format... I would do it like so: Offset: Bytes: Explain: 0 2 Title length... This could be one byte, I don't think any title will be longer than 255 bytes 2 2 Message length... You might want four bytes instead of two 4 2 Date 6 TitLen Title 6+TitLen Msglen Message ............................... Now I will explain myself. First I want to say that the above is only one message (though it is pretty obvious =P ). The next message would be the same format, it would start at "...............", or if nothing was left, you could have an end tag, or maybe just use EOF (Means "End Of File" for you newbies ;) ). Now like I said above, you may only want one byte for the title length, one byte, or a char has a max storage value of 255, would a title ever be this long? 2 bytes, or an int, has a max storage value of 65535... a message may be longer than this, wich is why you may want to use a long, or 4 bytes. A long has a max storage value of something like 4 billion... (I think) now I am sure you would never have a message this long! =P Whats all this mean you ask??? Well, if by now you didn't know, a char is actually the same as an int... that is mostly. An normal intager (int) on most compilers is 16bits, while a char is normally 8bits... I know a lot of people that where newbies and thought a char was special, that it didn't hold a value, but instead a character, such as 'A'. THIS IS NOT THE CASE! A char is actually just a number, and when used in strings it is used as an INDEX to the SYSTEMS character table! Sweet eh'? Why not use ints intstead of chars for a string you ask? Well, the system only has 256 characters, this makes a char perfect, since it can only hold 256 values (0-255). But actually, ints are used in unicode strings, for languages in the far east, that have MANY hundreds of characters (like Chinese). Then you ask, whats a bit? (Skip this if you already know what a bit is, what binary is, and how it works): Explanation of binary numbering system: in binary -- the numbering system used by the computer -- there is no 2's, 3's or even 4's.. it is all just true and false, or 1's and 0's... Like this: 0 0 0 0 0 0 0 0 <- bits (binary... what it looks like, true/false) 128 64 32 16 8 4 2 1 <- place value You see, in binary, every thing is done by place value, that means that the following number would be 7: 00000111 = 4+2+1 = 7 and this number is 18: 00010010 = 16+2 = 18 255: 11111111 = 128+64+32+16+8+4+2+1 = 255 Get it? Well, this is how a computer works, low down... So then you ask, why do I need to know this. Well for one, I am explaining what a bit is, a bit is simple, its either true or false. A byte is made up of 8 bits. A word (int) is made up of two bytes, and a double word (long) is made up of two words. Ok, now that I explained all that, I can explain how we can save binary data to a file. In C/C++ there are bitwise operators. Please goto the following link if you would like an explaination of these operators: http://www.harpercollege.edu/bus-ss/cis/166/mmckenzi/lect19/l19d.htm Now we can use these to load/save binary numbers from/to a file. Here are the functions I wrote John, please use them however you see fit, you don't need to give me credit if you don't want. But as I always say, I am not responsible in anyway for any damage my code may cause to anybody or anything. That doesn't mean it will break your computer though. Here these functions are, I've already tested them. /*---------------------------------------------------------------------------------*/ bool FileWriteByte(FILE *fileHandle, unsigned char Byte) { if (fputc(Byte, fileHandle)==EOF) return false; else return true; } /*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/ bool FileWriteWord(FILE *fileHandle, unsigned int Word) { if (FileWriteByte(fileHandle, (unsigned char)Word&~0xFF00)==false) return false; if (FileWriteByte(fileHandle, (unsigned char)(Word>>8)&~0xFF00)==false) return false; return true; } /*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/ bool FileWriteDWord(FILE *fileHandle, unsigned long DWord) { if (FileWriteWord(fileHandle, (unsigned int)DWord&~0xFFFF0000)==false) return false; if (FileWriteWord(fileHandle, (unsigned int)(DWord>>16)&~0xFFFF0000)==false) return false; return true; } /*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/ unsigned char FileReadByte(FILE *fileHandle) { return fgetc(fileHandle); } /*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/ unsigned int FileReadWord(FILE *fileHandle) { unsigned int Word; Word=FileReadByte(fileHandle); Word+=(FileReadByte(fileHandle)<<8); return Word; } /*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/ unsigned long FileReadDWord(FILE *fileHandle) { unsigned int DWord; DWord=FileReadWord(fileHandle); DWord+=(FileReadWord(fileHandle)<<16); return DWord; } /*---------------------------------------------------------------------------------*/ You have to open the file in binary mode for these to work. As a rule, I always open my files in binary mode. You may want to teach yourself to use this rule also. I can't even count the times that ASCII mode has made me rip my hair out looking for the "bug". You open a file in binary mode by just adding a 'b' into your file flags, like so: FILE *handle; handle = fopen("file.txt", "rb"); That will open "file.txt" as read (r) binary (b). In binary mode, the system wont mess with the data you get and save. However, in ASCII mode, it will try to iterpret the data, such as newlines and such. This is the only difference, and I have NEVER found a use for ASCII. It just causes bugs. Now you'll notice I do some bitwise operators. Such as on the WriteWord: if (FileWriteByte(fileHandle, (unsigned char)Word&~0xFF00)==false) return false; if (FileWriteByte(fileHandle, (unsigned char)(Word>>8)&~0xFF00)==false) return false; This is how our word (int) looks: (1)00000000 (2)00000000 Remember I said above that an int is made of two bytes... Well with the first line of code, I write the first byte to the file, or (2)... (2) You ask??? Well, in binary, hi-low is left to right, so the highest byte is actually on the left, the first byte is to the right. Hence (2). So the function call: FileWriteByte(fileHandle, (unsigned char)Word&~0xFF00) Is doing as follows: (unsigned char) - Typecasting to a byte Word - our value &~ - AND operator combined with the invert operator... this will turn of all bits on the left-byte that are true in the right-byte 0xFF00 - 11111111 00000000... So this combined with the above operator(s) will cause the whole upper byte of the two byte int to be turned off, hence leaving only the value of the lower byte. The second line of code is the same except that I first do a right-shift 8 times wich will shift the hi-byte to the low-bytes place. I am still turning off the hi-byte, because now it is all 1-bits, or 255 (11111111), Why??? Well when you do a right-shift (>>), the computer wills all vacant bits with 1's, and when you do a left shift (<<) the computer fills all vacant bits with 0, we don't want those bits on, because if they are, our value will be very large (No smaller than 65280), and since the value will wrap to a byte, it will be totally random. So we must turn those off so that we only have our hi-byte in the low-bytes place, then we can save it to a file. So basicaly, I am breaking up the int into it's bytes, and saving them to a file, as follows: int: 10100101 11100011 (42,467) File: byte1 (11100011), byte2 (10100101) Then on reading the byte, I do the opposite operations to re-make the value. Anyway, this e-mail is getting very long. The reson I would save the length in the file is this: You VERY easily could have ':' in your message... That would be bad, think of it. I was origionaly just going to tell you to use NULL char instead, like a string uses, but I got to thinking you may someday want to encrypt your messages, or something else like that, and then the NULL char might be in the message also. So then the only thing left to do is store the length in a intager in the file. This also makes programming it easier. Well if you have any questions, please ask me. Goodday and Goodluck! Wyatt