🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.lang.learn.c-c++
Article #208

Re: C Programming : Need help please .

#208
From: Martin Ambuhl
Date: Tue, 19 Jan 1999 00:00
64 lines
3147 bytes
CalvinKong wrote:
> 
> Can you explain in more detail ? The part that I don't understand is that it
> still work if I choose ignore in the popup Error box . So , this message is
> just merely a warning and not an error .


It it works it is merely an accident.  Your code is in error.  The
message is "merely a warning" that there is no reason to expect your
code to work and that it may easily start creating havoc in your
computer.  Pressing "ignore" is just yielding to your suicidal impulses.


> 
> --
> - Calvin Kong -
> ----------------------------------------------------------------------------
> --------
> Are you dare enough to enter my homepage ?
> Homepage : http://members.xoom.com/calvin_kong/
> Email          : ypkong@tm.net.my
> ICQ             : 3715937
> ----------------------------------------------------------------------------
> -------
> 
> Martin Ambuhl wrote in message <36A2D431.D11CAB41@earthlink.net>...
> >CalvinKong wrote:
> >>
> >> I had find out the part that causing the problem . But I still don't know
> >> why it occurs .. Logically , it should be okay . Here is a program that I
> >> extracted out and modified , please discuss with me ...
> >> ************************************************************
> >> # include <stdlib.h>
> >> typedef struct ListType {
> >>  int       item;
> >>  struct ListType *link;
> >> }Node;
> >> typedef Node *List;
> >>
> >> int main()
> >> {
> >>  List temp;
> >>
> >>  temp = (List)malloc (sizeof(List));
> >
> >sizeof(List) is just the size of a pointer.
> >If you would do with a typedef less, you would not confuse yourself:
> >   Node *temp;
> >   temp = malloc(sizeof *temp);
> >/* or, to be slightly less safe, 'temp = malloc(sizeof(Node));' */
> >remember to check the return value from malloc.
> >
> >
> >
> >
> >--
> >Martin Ambuhl (mambuhl@earthlink.net)
> >Note: mambuhl@tiac.net will soon be inactive
> >


-- 
Martin Ambuhl (mambuhl@earthlink.net)
Note: mambuhl@tiac.net will soon be inactive
Technical Details
Message-ID: <36A42D97.DCD0F1EB@earthlink.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <36a2cb23.0@news2.tm.net.my> <36A2D431.D11CAB41@earthlink.net> <36a37c53.0@news2.tm.net.my>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109edf,44c9aa94f48f7403
X-Google-Attributes: gid109edf,public
X-Google-Thread: f9d99,44c9aa94f48f7403
X-Google-Attributes: gidf9d99,public
X-Google-Thread: 1011f8,44c9aa94f48f7403
X-Google-Attributes: gid1011f8,public
X-Google-Thread: 114592,44c9aa94f48f7403
X-Google-Attributes: gid114592,public
X-Google-Thread: 10d4ba,44c9aa94f48f7403
X-Google-Attributes: gid10d4ba,public
From: Martin Ambuhl <mambuhl@earthlink.net>
Subject: Re: C Programming : Need help please .
Date: 1999/01/19
Message-ID: <36A42D97.DCD0F1EB@earthlink.net>
X-Deja-AN: 434316869
Content-Transfer-Encoding: 7bit
References: <36a2cb23.0@news2.tm.net.my> <36A2D431.D11CAB41@earthlink.net> <36a37c53.0@news2.tm.net.my>
X-Accept-Language: en
X-Posted-Path-Was: not-for-mail
Content-Type: text/plain; charset=us-ascii
X-ELN-Date: 19 Jan 1999 07:00:48 GMT
X-ELN-Insert-Date: Mon Jan 18 23:05:11 1999
Organization: Nocturnal Aviation
Mime-Version: 1.0
Newsgroups: alt.comp.lang.learn.c-c++,att.lang.c++,jaring.pcbase,tmnet.communities,tmnet.support