Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!uwm.edu!cs.utexas.edu!usc!brutus.cs.uiuc.edu!jarthur!jseidman From: jseidman@jarthur.Claremont.EDU (James Seidman) Newsgroups: comp.lang.c Subject: Re: const and struct pointers Message-ID: <4654@jarthur.Claremont.EDU> Date: 25 Feb 90 19:34:00 GMT References: <1214@watserv1.waterloo.edu> <90054.232325CMH117@psuvm.psu.edu> <414@charyb.COM> Distribution: all Organization: Harvey Mudd College, Claremont, CA 91711 Lines: 21 In article <414@charyb.COM> will@charyb.UUCP (Will Crowder) writes: >Actually, I'm somewhat surprised that Turbo C didn't just throw out the >"const" in: > > void asdf(const struct qwert a); > >I wouldn't think "const" would mean much for a non-pointer parameter passed >by value. I would think that "const" in this context would mean pretty much the same thing as it would in a normal variable declaration. That is, that the function asdf() won't change the parameter a locally. Granted, about the only use for this is to generate warnings if you accidentally do assign a new value to a (like in "if (a = 2) then...") and to improve readibility of code. Of course, this doesn't explain why the compiler complained, but it should not just throw away the "const" qualifier. -- ------------------------------------------------------------------------------- Jim Seidman, Harvey Mudd College, Claremont, CA 91711. (714) 621-8000 x2026 DISCLAIMER: I don't even know if these are opinions, let alone those of anyone other than me.