Solved

example of Linked List  on UNIX...

Posted on 1998-06-23
5
364 Views
Last Modified: 2010-05-18
I need to make a linked list on a SCO-UNIX box,  How do I do this?  Source code or links is what I am looking for.  I know how to do this is DOS, but since I don't the 'new' command in unix I don't know how to do it.

Thanks
0
Comment
Question by:theKman
  • 4
5 Comments
 
LVL 16

Accepted Solution

by:
imladris earned 100 total points
ID: 1251368
Given that this is the C Language forum, I will assume for the moment that you are using C, and wish to make linked lists in a C program.
If all that is correct, and if you used ANSI standard mechanisms in your DOS environment (such as malloc or calloc for allocating memory), then there will be no problem with doing that under UNIX (of any stripe).
The 'new' command, in the context of a programming language, is not an attribute of UNIX, but of C++. You can use that of course, but you certainly don't need C++ for either UNIX or linked lists.

0
 

Author Comment

by:theKman
ID: 1251369
Very good points,  however,  would you have some source code showing it?
0
 
LVL 16

Expert Comment

by:imladris
ID: 1251370
I don't have any linked list code lying around. I could cobble something together, however, my point is, since you say you can do it in DOS, that's all you need! You already have the source. There is no apparent reason why you DOS environment linked list code won't work under UNIX.
If you are in fact porting it and it is coming up with a problem, perhaps you could post a sample and we'll look at that. Or, if you simply want a sample of code to run a linked list (regardless of operating system) I can work up a simple example of that.

0
 
LVL 16

Expert Comment

by:imladris
ID: 1251371
On the example front; http://www.snippets.org contains public domain code for linked lists, and many more things besides. It is very general purpose. It will presumably work very well. It may or may not help with understanding principles.

0
 
LVL 16

Expert Comment

by:imladris
ID: 1251372
I'm not quite clear on why you are unhappy with that answer. Your original question was apparently searching for information with respect to the differences between DOS and UNIX.

I still believe the answer is: there isn't any. I offered to attempt to help resolve any porting problems you may have encountered, or provide sample code (even though you say you have linked list code), or a "professional" source.
If you are still in need of information along those lines, I am still willing to provide.

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SCANF - LIMIT THE NUMBER OF CHARARACTERS 1 58
Console based application in Linux 1 76
Need example 5 100
Unable to start eclipse ? 17 84
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now