[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] [C] linkede lister og warnings.



Kim Schulz wrote:
hejsa
jeg sidder og leger lidt med linkede lister, men kan ikke helt komme af
med nogle warnings ala:
functions.c:175: warning: assignment from incompatible pointer type
functions.c:183: warning: assignment from incompatible pointer type


Jeg har en struct


typedef struct {
	int ordernr;
	int hylde;
	int varenr;
	int antal;
	struct Orderliste *next;

} Orderliste;

og så har jeg mit opstartelement:
OrdreListe *Ordre;

jeg har funktioner som fint kan tilføje og fjerne elemener og det hele
virker for så vidt godt nok. Eneste problem er de der warnings jeg får hver gang jeg laver en Ordre = Ordre->next; (eller tilsvarende);


Hvad er det lige jeg overser?

Hvad jeg typisk gør i et sådant tilfælde er:


----------------------

typedef struct OrdreListe__o OrdreListe__t;

struct OrdreListe__o {
 int ....
 bla. bla.
 OrdreListe__t *next;
 };
----------------------

Nu ved jeg selvfølgelig ikke om dit problem er relateret til din skrivefejl Orderliste vs. OrdreListe ????
(Husk når du viser udsnit af dit program, at kopiere og ikke genskrive, afskrift går som regel galt.)


Med venlig hilsen
Egon Andersen



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:10 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *