Path: utzoo!censor!geac!torsqnt!hybrid!scifi!bywater!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c Subject: Re: char *'s and const char *'s Message-ID: <549@taumet.com> Date: 12 Jan 91 17:47:52 GMT References: <1991Jan11.182945.5437@nntp-server.caltech.edu> Organization: Taumetric Corporation, San Diego Lines: 13 bruce@seismo.gps.caltech.edu (Bruce Worden) writes: >int foo(char *file); >... knowing that foo() really only needs a const char *, it is often called as: > a = foo("myfile"); [ but this leads to compiler warnings ] >What is the method preferred/recommended by professionals and other experienced individuals? In this case I prefer to declare foo to take a const char*. Why mislead the compiler and human readers when it is easy to be helpful? -- Steve Clamage, TauMetric Corp, steve@taumet.com