LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 03-26-2004, 12:05 AM   #1
GoinEasy9
Member
 
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 it...ok...so 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 program...to 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
Tom
 
Old 03-26-2004, 01:00 AM   #2
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 46
There are a lot of open source programs on sourceforge. You can probably find one there by doing a search.

http://sourceforge.net
 
Old 03-26-2004, 01:36 AM   #3
aluser
Member
 
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:
http://www.hem.net/doc/postgresql-do...ibpq/examples/
and for its C++ library:
http://www.hem.net/doc/postgresql-do...pq++/examples/

freshmeat.net and sourceforge.net 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, 06:33 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,576

Rep: Reputation: 191Reputation: 191
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 http://www.hwaci.com/sw/sqlite/download.html
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-27-2004, 12:11 AM   #5
GoinEasy9
Member
 
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 again...now on to the links...lol
Tom

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-27-2004 at 12:20 AM.
 
  


Reply


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 09:27 PM
newbie learning to update Portage (w/Gentoo) Help! masterspud777 Linux - General 2 08-01-2003 06:23 PM
NEWB - Learning to code under GNU/Linux bkeating Linux - Newbie 5 10-09-2002 08:06 PM
Newbie learning Python busbarn Programming 3 08-09-2002 11:50 PM
Real newbie seeking info for learning. DaDdY SnEb Linux - General 5 06-19-2002 05:58 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:28 PM.

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