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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
03-14-2003, 12:20 AM
|
#1
|
|
Member
Registered: May 2002
Posts: 172
Rep:
|
book linked list in C
Does anyone knows a good book dealing with linked list
i am writing a liinked t but i ran into some trouble
language C
|
|
|
|
03-14-2003, 12:28 AM
|
#2
|
|
Senior Member
Registered: Jan 2003
Posts: 2,786
|
I don't know if there's a good book specifically for linked lists, but I learned C with the textbook "C By Dissection". As far as I can remember, it was pretty good.
What kind of problem are you having? I've written a few programs that use linked lists...
|
|
|
|
03-14-2003, 12:40 AM
|
#3
|
|
Member
Registered: May 2002
Posts: 172
Original Poster
Rep:
|
thx for the reply the trouble is want to read data from a file into linked list (no prob)
the i want to do a match strstr()(no prob)
but the i want wath i matched put into a temporary list
so i can do some aother function
i want to post my code but i am at work and typing it out of head is no option when i return at my home i will post if nessecary
|
|
|
|
03-14-2003, 12:44 AM
|
#4
|
|
Senior Member
Registered: Jan 2003
Posts: 2,786
|
Yeah, I'd need to see the code to understand what you're trying to do.
I doubt it will take long to get you on the right track...
|
|
|
|
03-14-2003, 12:47 AM
|
#5
|
|
Member
Registered: May 2002
Posts: 172
Original Poster
Rep:
|
thx man
|
|
|
|
03-14-2003, 12:59 AM
|
#6
|
|
Member
Registered: Sep 2002
Location: Canada
Distribution: Redhat 9.0
Posts: 637
Rep:
|
Sound like traversing a linked list, and removing nodes from the middle of the list. I have done that before, a long time ago.
|
|
|
|
03-14-2003, 01:01 AM
|
#7
|
|
Member
Registered: May 2002
Posts: 172
Original Poster
Rep:
|
is it possible instead of reemoving copying the matches to a tmp
linked list
|
|
|
|
03-14-2003, 01:05 AM
|
#8
|
|
Member
Registered: Sep 2002
Location: Canada
Distribution: Redhat 9.0
Posts: 637
Rep:
|
Do you want all the matched nodes in a separate list or just have them discarded? Either way it's possible. You would have to deallocate the node memory if you wanted to get rid of it, or else add it to the new list.
|
|
|
|
03-14-2003, 01:46 AM
|
#9
|
|
Member
Registered: May 2002
Posts: 172
Original Poster
Rep:
|
i want to put them in a seperate linked list
is it also possible to edit something
like the user performs a search and then
edit the search with backspace arrows and typing new data
like a text editor o like a shell where you can edit your command when you typed it in
|
|
|
|
03-14-2003, 02:05 AM
|
#10
|
|
Member
Registered: Sep 2002
Location: Canada
Distribution: Redhat 9.0
Posts: 637
Rep:
|
There is a '\b' character that can be used in your code in a condition test.
|
|
|
|
03-14-2003, 02:12 AM
|
#11
|
|
Member
Registered: May 2002
Posts: 172
Original Poster
Rep:
|
can you give an example
i don't get it
|
|
|
|
03-14-2003, 02:24 AM
|
#12
|
|
Member
Registered: Sep 2002
Location: Canada
Distribution: Redhat 9.0
Posts: 637
Rep:
|
Not really because I don't clearly know what kind of functionality that you want. I was thinking:
if ( getchar() == '\b' )
//move array index back one place?
However without your code, I'm lost.
|
|
|
|
03-14-2003, 02:43 AM
|
#13
|
|
Member
Registered: May 2002
Posts: 172
Original Poster
Rep:
|
fuctionality if you typed an author or example that you can edit like
you do in bash with your arrows
if i typed R. Richard Stevens
and it supposed to be W. Richard stevens
take your key go to the first R backspace or delete and
put the new letter
like you would edit a command in your bash when you et it out of your HISTFILE and you edit it for another purpose
|
|
|
|
03-14-2003, 09:23 AM
|
#14
|
|
Senior Member
Registered: Jan 2003
Posts: 2,786
|
Again, for Gtk or I to give you good information, we'd need to see some source.
However, let me say this. You've already got the code to support your file-based linked list. Why not use that foundation of code to support another linked list? There's no rule that says you can only have one linked list in a program. For the first list, you created a node for every line of the file. For the second list, create a node for each "match" you find in your original.
|
|
|
|
03-16-2003, 10:52 AM
|
#15
|
|
Member
Registered: May 2002
Posts: 172
Original Poster
Rep:
|
thx guys already found it
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:18 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|