Quote Originally Posted by citizen View Post
Pointers (again): This time Elysia's restated that stray pointers should not be dereferenced and provided at least one entirely wrong and narrow minded (pointers == dynamic memory mentality) example of how to fix it. And const correctness as it relates to char*. Const correctness is an article I linked to that needs writing.
I changed it to "one way of doing it the correct way" instead. Perhaps that's more to your tastes?

I request, Elysia, that you avoid creating articles that overlap one another for the time being, for two important reasons. The encyclopedia is not at all complete and we can argue about what articles can be coupled together as "common mistakes" and where to refer readers to at a later date. By the incompleteness statement I mean that there are a lot of topics still out there - inheritance is another big place where people screw up a lot, is it "common"? Does anybody want to teach OOP? We're hardly ready to start this sort of spit-shining.
Do you want to write an entire const correctness article for fixing char* when it should be const char*? Go ahead. However, I don't want to.
There are a lot of things and you can argue what to be added and not. But I don't think small things like that do not hurt.

And secondly, some of the articles you've referenced don't seem to apply best to the mistakes in question. Why does const correctness relate to your article on vertual memory? Why not write the const correctness article instead?
Should it be linked to const correctness? Yes. Is there one one? No. Do I want to write one? No.
Feel free to write one and change the link.

Quote Originally Posted by jEssYcAt View Post
The "Right Way" for C appears to pass a garbage value to malloc for how much to allocate:

If this isn't an error, can someone explain why the value of some random memory location is given to malloc() here?
Forgot sizeof. Fixed.