LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Search Forums
User Name
Password

Notices


Showing results 1 to 3 of 3
Search took 0.01 seconds.
Search: Posts Made By: NevemTeve
Forum: Programming 01-28-2024, 10:02 AM
Replies: 20
Views: 597
Posted By NevemTeve
That's mostly true. But what do you do if you...

That's mostly true. But what do you do if you have to maintain a linked list in a multi-process-shared memory? In such shared memries you cannot use pointers, you have to use offsets instead. Which...
Forum: Programming 01-28-2024, 12:03 AM
Replies: 20
Views: 597
Posted By NevemTeve
Let's pick a use case: we want to insert a new...

Let's pick a use case: we want to insert a new elem into a sorted list. I'm afraid neither of the listed method works.

Elem *p= NULL, pprev= NULL, pnext= first;
int found= 0;
for (!found &&...
Forum: Programming 01-27-2024, 12:30 PM
Replies: 20
Views: 597
Posted By NevemTeve
Simply: pnext= first; while ((p=...

Simply:

pnext= first;
while ((p= pnext)!=NULL) {
pnext= p->next;
...
process *p
...
}
Showing results 1 to 3 of 3

 

Didn't find what you're looking for? Try Google:


  



All times are GMT -5. The time now is 03:18 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration