OK, so I'm back trying to reinvent the wheel again, because it's fun
Now, I just thought I'd ask. Here's the deal. This is some kind of linked list, you might suppose, that's to be written to a file (or two).
So, I have a data file that contains data and a linked list structure saved as an index.
To make things easier, I decided to store the index structures in a separate file, so seeking and re-writing index wouldn't be necessary as the data file expands.
However, the thing is that the index structure is of variable length due to a string inside it. So either I make it static length by pre-allocating say, 255 chars for the length (which I find bad since it limits the length of the name and [often] wastes a lot of space for nothing) or I can do another linked list approach to write the length of the index.
So you read the length of the index, seek that amount of bytes and you'll be at the start of the next index.
Or, I could make a small table at the beginning of the file with offsets to all the indexes. These are in the case the index is variable length.
Another thing I might try is to write the string to the data file and keep track of its offset in the index.

So, my question would be, what do you think?
Either:
- Make index static length (fixed amount of width for string).
- Write string to data file and make index static length.
- Make index variable length with a linked-list approach to save the amount of bytes the index takes at the start of the each index so you can travel from index to index.
- Make index variable length and save a table at the beginning of the index file with positions of each index.
- Some other solution you might think is a good thing.

For the curious, here's what the current draft of the index structure looks like:
Code:
	class CIndex
	{
		friend class CRegistry;

	private:
		UINT64 nIndexLength;
		CString strName;
		UINT64 nOffset;
		DWORD dwSize;
		DWORD dwType;
		DWORD dwElements;
		DWORD dwTreeLevel;
		CIndex* pParent;
		CIndex* pNextSibling;
		CIndex* pPrevSibling;
		CIndex* pChild;
		CIndex** pEnd;
		DWORD dwParentID;
		DWORD dwNextSiblingID;
		DWORD dwPrevSiblingID;
		DWORD dwChildID;
		UINT64 dwId;

		ERROR1 Save(CRegistry::CKey& Key);
		ERROR1 Load(CRegistry::CKey& Key);
		DWORD GetIndexDataSize() { return strName.GetLength() + 4; }

	public:
		bool operator == (const CIndex& rCompare) { return (dwId == rCompare.dwId); }
		bool operator != (const CIndex& rCompare) { return (dwId != rCompare.dwId); }

		#define REGTYPE_FREE 0
		#define REGTYPE_KEY 1
	};
What is the code? It's a reinvent of the registry, of course
Comments have been stripped to reduce the size of the code block.