Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mimsy!oddjob!gargoyle!ihnp4!inuxc!iuvax!bsu-cs!dhesi From: dhesi@bsu-cs.UUCP (Rahul Dhesi) Newsgroups: comp.sys.ibm.pc Subject: Re: ** Re: MSC 4.0 Large Model ** Original Posters problem solved!!! Message-ID: <1014@bsu-cs.UUCP> Date: Thu, 20-Aug-87 18:34:55 EDT Article-I.D.: bsu-cs.1014 Posted: Thu Aug 20 18:34:55 1987 Date-Received: Sat, 22-Aug-87 14:34:59 EDT References: <10400006@altger.UUCP> <72@cunixc.columbia.edu> Reply-To: dhesi@bsu-cs.UUCP (Rahul Dhesi) Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 25 In article <72@cunixc.columbia.edu> nwc@cunixc.columbia.edu (Nick Christopher) writes: > 1) Use NULL not 0 as often as applicable. Actually, I suggest simply casting 0 or NULL, whichever you use, to the correct type when passing it as a parameter. When simply using it for a comparison, a cast is not necessary and either may be used. > 2) use sizeof()'s in malloc()'s and calloc()'s i.e.: [...] > s = malloc((strlen(s2)+1)*sizeof(char)); Purists constantly perpetuate this nonsense. Actually, Kernighan and Ritchie say the following about the sizeof operator on page 126: The size is given in unspecified units called "bytes", which are the same size as a 'char'. Hence sizeof(char) is guaranteed to be exactly 1 and there is no need to multiply by it. Other recommendations made by nwc@cunixc.columbia.edu make a lot of sense. -- Rahul Dhesi UUCP: {ihnp4,seismo}!{iuvax,pur-ee}!bsu-cs!dhesi