Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!uunet!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!engage.enet.dec.com!ynotme.enet.dec.com!wallace From: wallace@ynotme.enet.dec.com (Ray Wallace) Newsgroups: comp.lang.c Subject: Re: What's Wrong with this C Excert Message-ID: <1955@engage.enet.dec.com> Date: 7 Aug 90 20:50:49 GMT Sender: news@engage.enet.dec.com Distribution: usa Organization: Digital Equipment Corporation Lines: 20 In article <34877@ut-emx.UUCP>, ezab066@ut-emx.UUCP (Albert Wu) writes... >The following is part of an example I saw on p.301 of Byron S. >Gottfried's Schaum's Outline Series "Programming with C", copyrighted > *a = (int*) malloc (rows * ncols * sizeof(nt)); > *b = (int*) malloc ( nrows * ncols * sizeof(int)); > *c =(int*) malloc ( nrows * ncols * sizeof(int)); should be a = (int*) malloc (nrows * ncols * sizeof(int)); b = (int*) malloc ( nrows * ncols * sizeof(int)); c =(int*) malloc ( nrows * ncols * sizeof(int)); that is you need to remove the pointer prefix from in front of the variables on the left side of the assignment statement. --- Ray Wallace (INTERNET,UUCP) wallace@oldtmr.enet.dec.com (UUCP) ...!decwrl!oldtmr.enet!wallace (INTERNET) wallace%oldtmr.enet@decwrl.dec.com ---