Advanced Topic - Doing it differently.

Michael Barton palrich at gmail.com
Thu Apr 7 06:15:00 New Zealand Standard Time 2005


> Sorry, but I fail to see any appreciable difference between the two examples of
> code. The only difference I noticed was #include vs import. Other than that

haha.. I had exactly the same thought.
So I rewrote the other in C real quick.

#include <stdio.h>
#include <sqlite.h>

int main()
{
  char *error = NULL;
  sqlite *db = sqlite_open("file.db", 0666, &error);
  if(!db)
  {
     printf("DB create error: %s\n", error);
     return 1;
  }
  printf("DB open!\n");
  sqlite_close(db);
  printf("DB closed.\n");
  return 0;
}

The horrors!


On Apr 6, 2005 12:18 PM, Chad Simmons <polpak at yahoo.com> wrote:
> 
> --- Christopher Bunting <cbunting99 at gmail.com> wrote:
> > One last reply to this thread.. Since part of this thread had to do
> > with Databases, and then where I mention why I use the d programming
> > language, I'll show the code that is needed to connect Rom to the
> > SQLite database using both the C API and my D API. This is why I moved
> > from C to D
> 
> Sorry, but I fail to see any appreciable difference between the two examples of
> code. The only difference I noticed was #include vs import. Other than that
> they both seemed identical except where they were functionally different. e.g.
> The C example prints a usage error, as well as executes a query whereas the D
> example only opens then closes the database.
> 
> -----BEGIN GEEK CODE BLOCK-----
> Version 3.1
> GCS/L/C/O d-(+) s++: a-- C+++$>++++ UBLS++++$
> P+++(--)$ L+++>++++ E--- W+>++$ N !o K? w(--) !O
> M- !V PS+ PE(++) Y+ PGP->+ t+ 5 X+() R(+) tv+@
> b++(+++) !DI+++ D G(-) e>+++$ h---() r+++ y+++
> ------END GEEK CODE BLOCK------
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Personals - Better first dates. More second dates.
> http://personals.yahoo.com
> 
> --
> ROM mailing list
> ROM at rom.org
> Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>
-- 
ROM mailing list
ROM at rom.org
Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom


More information about the MUD-Dev mailing list