Originally Posted by
matsp
In trivial cases, it would be possible for the compiler to detect it, but in anything but trivial cases (e.g. when a function takes a char * as a parameter, and that char * happens to be a pointer to a literal).
It's not just obaid's code that does so, by the way, several of the other examples do too. Maxorators doesn't - but it also doesn't match the original poster's question - and by the way, we haven't seen any post from the OP for a while.... Perhaps the lesson ended? :-)
--
Mats