To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 1836
1835  |  1837
Subject: 
Re: Dynamic lists allowed?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Thu, 12 Apr 2001 22:53:13 GMT
Viewed: 
1413 times
  
On Thu, 12 Apr 2001, Juan Gonzalez wrote:

Since I just got started with legOs (thanks to 'Extreme Mindstorms'), I'm
creating a set of high level utility functions.  This one here is intended
to display a DYNAMIC list of values, but there seems to be a problem with
the use of 'struct' and pointers.

Have I gone too far?  Some of the kernel modules use pointers...

If you're interested, this is a circular list which is constantly being
displayed by a thread, while the main process keeps adding entries to the list.

struct tNode {
  char text[6];
  int value;
  tNode *next; • This should be "struct tNode *next;"
  } list;

After this, any time you want to refer to a tNode, you need to say "struct
tNode". Or you can put "typedef struct tNode tNode" and then use the
"tNode" as a type like you're doing.

--
"From now on, we live in a world where man has walked on the moon.
And it's not a miracle, we just decided to go." -- Jim Lovell

Mike Ash - <http://www.mikeash.com/>, <mailto:mail@mikeash.com>



Message has 1 Reply:
  Re: Dynamic lists allowed?
 
(...) Thanks for your help. The program is running fine now. Would you happen to know if anyone has created this sort of high level functions? If not more people might be interested. jm (24 years ago, 13-Apr-01, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Dynamic lists allowed?
 
Since I just got started with legOs (thanks to 'Extreme Mindstorms'), I'm creating a set of high level utility functions. This one here is intended to display a DYNAMIC list of values, but there seems to be a problem with the use of 'struct' and (...) (24 years ago, 12-Apr-01, to lugnet.robotics.rcx.legos)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR