delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/01/31/01:46:28

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: King Chung Huang <kinghuang AT NOSPAMearthlink DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Linked Lists Help!
Organization: University of Calgary
User-Agent: MT-NewsWatcher/3.0 (PPC)
Message-ID: <kinghuang-0D63B9.23404830012002@news.uncensored-news.com>
NNTP-Posting-Host: news.uncensored-news.com
Lines: 55
X-Report-Abuse-To: abuse AT uncensored-news DOT com Send only the header of the offending post, DO NOT attach any file.
X-Comment: NOTICE: Uncensored-News.Com does not condone, nor support, spam, illegal or copyrighted postings.
X-T.O.S.: http://www.uncensored-news.com/terms.html
Date: 31 Jan 2002 06:40:47 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi everyone,

I'm trying to create a linked list in C. Here's a snippet of relevant 
code:

typedef struct {
   // metadata
    char name[256];         // window title name
    unsigned short x;       // x co-ordinate position of the window
    unsigned short y;       // y co-ordinate position of the window
    unsigned short width;   // width of the content region (local)
    unsigned short height;  // height of the content region (local)
    short isDirty;          // does the window need updating?
    
   // content data
   struct qdPort *qdRef;   // the qdPort
   
   // links
   struct qdWindow *above; // next window above
   struct qdWindow *below; // next window below
} qdWindow;



// create a new window structure
        struct qdWindow *newWindow;
        newWindow = malloc(sizeof(qdWindow));
        
        // links
        newWindow -> below = windowTop;
        newWindow -> above = NULL;
        windowTop -> above = newWindow;
        windowTop = newWindow;


The problem i'm having is that when i go to compile, every line that has 
"newWindow -> (some field) = (something)" generates the error 
"dereferencing pointer to incomplete type". I've scoured all my books on 
linked lists in C, and I can't figure out what I'm doing wrong. Does 
anyone have any ideas?

TIA

-- 
REMOVE 'NOSPAM' TO EMAIL ME
King Chung Huang           kinghuang AT NOSPAMearthlink DOT net
Learning Commons                     Tel: (403) 220-4949
University of Calgary                Fax: (403) 282-0730
2500 University Dr. NW          Streaming Video Showcase
Canada                    http://commons.ucalgary.ca/qtv

______________________________________________________________________
Posted Via Uncensored-News.Com - Still Only $9.95 - http://www.uncensored-news.com
   With NINE Servers In California And Texas - The Worlds Uncensored News Source
  

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019