-
February 17th, 2013, 06:53 PM
#1
Question about dynamic data structures and information input
Not sure exactly how I should have put that title, but since my intelligence isn't exactly high, that's the best way to put it. My question is say that I want to have input data stored in a database. All information entered is to be stored under a single block. That way whenever I want to recover that information all I have to do is point to that block. Think of it like this. I want a large square block that can hold certain information. Inside of that large block are a finite amount of smaller blocks in which the user entered information about a single subject. Lets say block 1 has a name, address, and phone number. The second block will have the same TYPE of information, but different values as entered by the user. I.E:
BLOCK 1: Name 1, Address 1, Phone 1
BLOCK 2: Name 2, Address 2, Phone 2
etc.
The large block contains all of the smaller blocks, we will name the large block "Address Book"
How would I implement that? Of course it would be just a simple console program that would erase all information when the program shut down, but I've been trying to figure out how to do it, but just can't seem to grasp a good notion of how to do it. What would be the best way to do that? Structures? How would I make it dynamic so that I wouldn't have to define every block, so that it would be added on the fly when someone inputs new information.
Thank you.
-
February 18th, 2013, 01:00 PM
#2
Re: Question about dynamic data structures and information input
-
February 18th, 2013, 01:14 PM
#3
Re: Question about dynamic data structures and information input
You want a struct or class for what you call the small blocks, and a container such as a vector, list or map for what you call the large blocks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|