C Database

Discussion in 'C Programming' started by raviz, Mar 13, 2006.

  1. raviz

    raviz Guest

    i want to know how to create a database of your own using c or c++.
    without using any external tools. if any body could provide me an idea
    to go by it would help me a lot, also if their is any sample code it
    would help me a lot.
     
    raviz, Mar 13, 2006
    #1
    1. Advertising

  2. raviz said:

    > i want to know how to create a database of your own using c or c++.
    > without using any external tools. if any body could provide me an idea
    > to go by it would help me a lot, also if their is any sample code it
    > would help me a lot.


    First step - decide what you mean by "database". If you want to write a
    full-blown SQL parsing engine, you're in for the long haul. If you simply
    want to be able to store some data in a reasonably generic format and be
    able to perform simple Create/Retrieve/Amend/Purge (or, if you prefer,
    Create/Retrieve/Update/Delete) on that data, you can do quite a lot with a
    bunch of ordinary text (or even binary) files.

    At the bottom level, you're going to be using fopen, fread (or, if you're
    like me and prefer text format, a custom-written routine to get a complete
    line of text, and some parsing code to interpret it for you), fwrite (or
    fprintf), fclose, and the like.

    How much you build up from that is entirely up to you. You'll need to come
    up with some kind of concrete design first, and then have a go at
    implementing it. If you get stuck on the C implementation part of it, let
    us know what you've got, what you want it to do, and what it's doing
    instead, and you'll very likely get good support here. But alas, we don't
    have time to do all your design and programming work for you.

    --
    Richard Heathfield
    "Usenet is a strange place" - dmr 29/7/1999
    http://www.cpax.org.uk
    email: rjh at above domain (but drop the www, obviously)
     
    Richard Heathfield, Mar 13, 2006
    #2
    1. Advertising

  3. raviz

    Richard Bos Guest

    "raviz" <> wrote:

    > i want to know how to create a database of your own using c or c++.
    > without using any external tools. if any body could provide me an idea
    > to go by it would help me a lot, also if their is any sample code it
    > would help me a lot.


    Design a database file format or find one you like on
    <http://www.wotsit.org/search.asp?s=database>. Then go wild with
    fopen(), fwrite(), fread(), fgetpos() and fsetpos().

    Sample code? Sure. Decide what you _actually_ want to do ("create a
    database" is just a tad vague), then do a websearch.

    Richard
     
    Richard Bos, Mar 13, 2006
    #3
  4. raviz wrote:
    > i want to know how to create a database of your own using c or c++.
    > without using any external tools. if any body could provide me an idea
    > to go by it would help me a lot, also if their is any sample code it
    > would help me a lot.


    If you want to see what a relational database implemented in C looks
    like, check out the freely available and open source database engine
    SQLite:
    http://www.sqlite.org/

    -Charlie
     
    Charles Mills, Mar 13, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luis Esteban Valencia
    Replies:
    1
    Views:
    1,394
    Carl Prothman [MVP]
    Jan 12, 2005
  2. =?Utf-8?B?U1M=?=
    Replies:
    3
    Views:
    3,838
    Juan T. Llibre
    May 15, 2005
  3. Replies:
    8
    Views:
    464
  4. casper
    Replies:
    0
    Views:
    9,054
    casper
    Apr 24, 2006
  5. Keith
    Replies:
    1
    Views:
    2,326
    Keith
    Jul 3, 2006
Loading...

Share This Page