Data Storage Method

This is a discussion on Data Storage Method within the C Programming forums, part of the General Programming Boards category; I am writing a program to test/increase a user's vocabulary in a foreign language. I eventually want to provide edit ...

  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    8

    Question Data Storage Method

    I am writing a program to test/increase a user's vocabulary in a foreign language. I eventually want to provide edit functionality (users can add new words) and "plug-in" functionality for additional dictionaries but v1.0 will only have a single static language dictionary.

    What is the best method to store and retrieve data? The data stored will be "word pairs."

    Example (English <-> Japanese):

    one:ichi
    two:ni
    three:san

    Since the user has an option to repeat wrong answers, I have chosen a linked list style to manage the word pairs.

    Code:
    struct node {
      char* english;
      char* japanese;
      struct node* next;
    }
    However, I need a method of "storing" the dictionary. Is it most efficient to store it as a text file? I would prefer the list to be encrypted or otherwise stored so that a user can't freely edit the dictionary with a text editor. Should I store the words in the source code somehow? If so, what is the best way to do this?

    Long term, I need to be able to store UTF-8 code for foreign language characters such as SHIFT-JIS, for example, for Japanese.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,825
    A balanced tree, or a hash would be preferable to a linked list.

    As for encrypting the input file, the key would need to be stored somewhere. Yes, you'll stop the casual reader, but if someone wants it bad enough, they'll probably get it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 05-05-2009, 05:53 PM
  2. C++ data storage
    By aewing30 in forum C++ Programming
    Replies: 5
    Last Post: 04-28-2008, 03:19 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM
  4. Replies: 4
    Last Post: 06-14-2005, 06:45 AM
  5. C diamonds and perls :)
    By Carlos in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 05-16-2003, 11:19 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21