Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-25-2004, 11:05 PM   #1
Registered: Feb 2004
Location: Manorville, New York, USA
Distribution: siduction, Fedora 19, openSUSE Tumbleweed
Posts: 379
Blog Entries: 1

Rep: Reputation: 47
newbie learning C++ needs to see code

Hi All

I'm a programmer who hasn't programmed in about 10 years... back in the 80's i was a pretty good DOS programmer...programmed in Forth and Assembler...did some database work using Foxbase (a Dbase clone that ran a whole lot faster than Dbase)...was a Novell reseller....ok, enuf of my background

I closed my consulting and programming business when everyone was experimenting with windows and it caused problems with the software i'd had written (Forth accessed the memory locations directly so it blew up windows).
MicroSoft bought Foxbase because it had such great (and fast) indexing routines. M$ made it visual Foxbase and destroyed i gave up.

I have a client who has been running a program I wrote 20 years ago...he still goes and buys 386 computers at used computer dealers so he can still use it...i luv this guy...his motto:if it works don't fix it...but it's close to the 20th anniversary of its delivery.

i want to suprise him and give him a new version of the run on a linux machine..with the program written in "C++"

my learning curve would take months....the fastest way for me to learn "C" would be to look at someone else's code ... so i can learn by studying line for line what was written.

can anyone direct me to an open-source program where i can actually look at code written to set up a database program in "C"....

my client runs a marina....has boat slips, does maintenance etc...database inbedded in database etc...i'm not looking to copy code...just learn...could be any type of multiple database program.

any help would be appreciated...

i'm not looking to get paid for the program i'm writing...i would just like to surprise my old client...and get him to run his marina in linux.

Thanks in advance
Old 03-26-2004, 12:00 AM   #2
Senior Member
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 47
There are a lot of open source programs on sourceforge. You can probably find one there by doing a search.
Old 03-26-2004, 12:36 AM   #3
Registered: Mar 2004
Location: Massachusetts
Distribution: Debian
Posts: 557

Rep: Reputation: 42
For any sort of serious database you should use an existing database app: the two commonly used open source ones are mysql and postgresql. There are libraries for accessing either of these from C. You will have to decide for your project whether a full fledged database backend is warranted. It could be that using one lets you add new features which would have been difficult to work into your original. It could also be needless complexity

Here are some examples from the postgresql docs for using using its C library:
and for its C++ library: and both have a ton of open source stuff to look at. The problem is finding what you're looking for, of course.

For learning C, the book called "The C Programming Language" by Kernighan and Ritchie is considered a necessity by a lot of people. I learned on it and have reread it several times. The fact that the entire language is clearly described in a relatively tiny book is a good thing.

For C++, which looks very different than C when well written, I haven't come across a book which seems as good. I read "The C++ Programming Language" by Bjarne Stroustrup (spelling?) and thought it was good, but it's very long. The length is somewhat of an indictment of the language; C++ has way more syntax than C.

Getting yourself indoctrinated into the whole "object oriented" business in preparation for making full use of C++ will take some time. On the other hand, OO thinking helps a lot in writing neat C.

You'll want to get acquainted with development tools on linux if you don't already have favorites.
  • Editor: vim or emacs
  • Compiler: gcc or g++ for C or C++
  • make
  • Debugger: gdb or ddd, which is a GUI front end to gdb
  • ctags -- works with your editor to jump to definitions of functions or variables
  • autotools -- Including automake and autoconf. These help get your program to compile on different *nix platforms without user intervention, as well as enable or disable features at compile time depending on the platform or whim of the user.

hope that was helpful : )
Old 03-26-2004, 05:33 PM   #4
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,655

Rep: Reputation: 210Reputation: 210Reputation: 210
It depends if you'd like to write your own database program or use existing database server (as most people do nowadays).
In both cases I recommend you to try one of simplies SQL servers: SQLite
It's not too big to understand the code.

You can also learn how to use one of SQL servers (like MySQL, Postgre, Firebird), create the tables you'd like to have and use client library to pass SQL commands to the server.
Old 03-26-2004, 11:11 PM   #5
Registered: Feb 2004
Location: Manorville, New York, USA
Distribution: siduction, Fedora 19, openSUSE Tumbleweed
Posts: 379
Blog Entries: 1

Original Poster
Rep: Reputation: 47
Thank you all...alot of good suggestions...i'm going to look at them all
The program may or may ot be used on a network...right now it's stand alone on a desktop...

Back in the 80's i was a reseller for SBT accounting software...the code was written in dbase...and was sold along with compiled code so a reseller could modify it for his/her clients....i learned more about programming by modifying that code, and seeing other programmers techniques, than by trying to start from scratch....

Thanks on to the

p.s. back to edit...after reading the posts closer i need to thank u all again...very helpful....thankx

Last edited by GoinEasy9; 03-26-2004 at 11:20 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
What Programs Have Good 'C' code for learning? DvChWi Programming 1 04-30-2005 08:27 PM
newbie learning to update Portage (w/Gentoo) Help! masterspud777 Linux - General 2 08-01-2003 05:23 PM
NEWB - Learning to code under GNU/Linux bkeating Linux - Newbie 5 10-09-2002 07:06 PM
Newbie learning Python busbarn Programming 3 08-09-2002 10:50 PM
Real newbie seeking info for learning. DaDdY SnEb Linux - General 5 06-19-2002 04:58 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:57 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration