Topic: What is th best way to write a database in C++ ?


Author: Sergio Derada <derada>
Date: 1995/05/12
Raw View
What is th best way to write a database in C++ ? Assuming the database is as
simple as NAME,AGE, how would a flat-file database be set-up in C++. Two
arguments were proposed:

1)      2)
class DBclass {     struct DBrec {
char name[25];     char name[25];
char age[3];     char age[3];  }
public:
/* all DB methods */    class DBclass {
}      DBrec Rec[100];
      public:     .      /* all DB methods */
      }
      .
      .
DBclass myDB[100];    DBclass myDB;

Your choice, why ? why not? Do you have any other suggestions?