Dynamic/Custom arrays, filestorage (databases)
-
Hi, I'm looking for a way to produce a program that will allow the user to store records of particular things they want, but they initially choose what type of data they want to store for the records. For example, if the user wants to store loads of records consisting of three string types, all the program would need to store are three CStrings (or whatever). If they want to store say two strings, two true and falses and a number, the program would need to be able to store two CStrings, two BOOLs and an int. Basically it would be like a custom database, but the problem I've got with it is setting up how the storage would work in an array and saving to file. At present, I've got 12 fields available (4 strings, 4 BOOLs and 4 ints) and the user can tick or untick them if they want them or not. All fields are stored. But not only is this wasteful in terms of storage and memory in terms of the fields not being used, but it doesn't give the user as much control as I want to. I know using an existing database engine would be a lot easier, but has anyone got any ideas or pointers as to how to go about creating a custom one? Many thanks, Peter Pearson