Originally Posted by
inu11byte
Stop getting your panties in a bunch, he was giving him some example code. It's not like the original poster wanted a code written for him for a specific task, it was for an exercise in his book. I see no problem with posting some code for someone to see how it is implemented.
Now, as for casting malloc... You need to cast malloc if you want it to compile in both C and C++... It doesn't hurt anything, just makes it compile in C++.
EDIT: I don't mean this as a flame, I was just merely voicing my opinions. Sorry if this sounds a little insulting. <3