Newsgroups: comp.os.msdos.djgpp From: Elliott Oti Subject: Re: passing arg 1 of 'free' .... Sender: usenet AT fys DOT ruu DOT nl (News system Tijgertje) Message-ID: In-Reply-To: <358A5A9F.E57B1F07@pac.nl> Date: Fri, 19 Jun 1998 14:50:00 GMT Content-Type: TEXT/PLAIN; charset=US-ASCII References: <358A5A9F DOT E57B1F07 AT pac DOT nl> Mime-Version: 1.0 Organization: Physics and Astronomy, University of Utrecht, The Netherlands Lines: 29 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Fri, 19 Jun 1998, Theo Landgraf wrote: > i get this warning: > > passing arg 1 of 'free' discards 'const' from pointer target type. > > what does this mean? > how can i solve it? It means you are trying to delete (i.e. alter) a pointer after informing the compiler that you are going to do no such thing by declaring the pointer as const. const char *myptr; // means I am not going to alter myptr => myptr = const free(myptr); // means please release the memory pointed to by myptr // and make myptr = NULL; If you are going to alter myptr don't declare it as const char *, just as char *. Cheers, Elliott Oti kamer 104, tel (030-253) 2516 (RvG) http://www.fys.ruu.nl/~oti