Teaching const

Karl Heuer karl at haddock.ISC.COM
Sat Apr 2 17:57:14 AEST 1988


In article <10203 at steinmetz.steinmetz.ge.com> davidsen at kbsvax.steinmetz.UUCP (William E. Davidsen Jr) writes:
>Could someone give me a good method to use when teaching students C,
>such that they will be able to remember the syntax of
>	pointer to {type} const
>	- vs -
>	const pointer to {type}

If you write "{type} const" rather than "const {type}", then "const" follows
pretty much the same rules as "*".  You can use whatever method you use to
distinguish "pointer to function" from "function returning pointer".

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list