The comment about changing the const pointers is subtly wrong. There are pointers to const memory and there are const pointers to memory. My favourite little known C fact. See also <a href="http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;1143262&#x2F;" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;1143262&#x2F;</a>