By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,886 Members | 1,107 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,886 IT Pros & Developers. It's quick & easy.

Can somebody suggest a "C lang" project with pointers and linked lits for beginner?

P: n/a
Guys:
Can somebody suggest a "C lang" project with pointers and linked lits
for beginner?. Also is there anywahere I can find some C projects?.
Thanks in advance.

Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

<sa***********@yahoo.com> wrote
Guys:
Can somebody suggest a "C lang" project with pointers and linked lits
for beginner?. Also is there anywahere I can find some C projects?.
Thanks in advance.
Bible editor.


Get an online bible.

The task is to load it into memory. When the user types chapter and verse,
the verse should appear on screen. He can then add a footnote, which is
stored as text in square brakets, or change the translation. Finally he can
save his changes.

The best way to inplement this is to have a linked list of verses. There is
too much text to shift about in memory with each edit.

Nov 15 '05 #2

P: n/a
"Malcolm" <re*******@btinternet.com> writes:
<sa***********@yahoo.com> wrote
Guys:
Can somebody suggest a "C lang" project with pointers and linked lits
for beginner?. Also is there anywahere I can find some C projects?.
Thanks in advance.
Bible editor.


Get an online bible.

The task is to load it into memory. When the user types chapter and verse,
the verse should appear on screen. He can then add a footnote, which is
stored as text in square brakets, or change the translation. Finally he can
save his changes.

The best way to inplement this is to have a linked list of verses. There is
too much text to shift about in memory with each edit.


If you read the entire Bible into a single linked list of verses,
you're going to spend most of your time traversing it.

A better data structure would be a list of books, where each book is a
list of chapters, and each chapter is a list of verses. At each
level, the "list" can be implemented either as a linked list, or as an
array of pointers. Each array can be allocated using malloc(), and
resized if necessary using realloc() (e.g., if you decide to add a
chapter or verse here and there). Using just linked lists should give
you acceptable performance; using a hierarchy means all your lists are
shorter than 200 elements.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.