Everyone ought to put that link in their signature. That and the one about gets().
Printable View
Everyone ought to put that link in their signature. That and the one about gets().
Like i said doesent matter. With a good compilier like gcc its really a mute point. But i do understand why its not needed. :)
In addiiton to the FAQ, you never need to typecast a void pointer when assigning one. Ever. There's no reason to do it, because the assignment is automatically promoted to whatever type you're assigning them to. Anything else is just a waste of keystrokes.
Quzah.
> sizeof(char) is one, so there is no point in multiplying by it.
If you write
p = malloc ( n * sizeof *p );
then this always works and you never have to worry about 'remembering' to multiply by your object type.
The problem with optional things (like braces in single line if statements for example) is that sooner or later, it's not what you want and you don't even realise it until much later when you get that big "DOH" moment.
Of course, the OP seems to have gone away and taken their mysterious program with them, so I guess we'll never know.