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

S

santa19992000

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.
 
M

Malcolm

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.
 
K

Keith Thompson

Malcolm said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top