Re: Malloc code



Replies inline:

Robby wrote:
This is bottom posting right? I find it makes more sence than top posting. IMO!
I could be wrong!

What you (and I) are doing here is "inline posting" or "interleaved posting" (see Wikipedia discussion). It sometimes works better if the post has many parts, as yours do.

You are still quoting the whole of my previous message below your signature. In the Wikipedia discussion this is called "double-quoting", a mixture of top-posting and inline quoting. Very very bad IMHO.

It's int main(), not void main().

I tried it as you say:

int main()
{

... other code

return 0;
}

and it works as well. Either way works. Is there a reason as to why

void main()
{
... other code
}

Just because a given compiler (especially yours!) accepts something does not make it right. The only correct return value from main() is int. Some will accept void, some will issue a warning, and some will reject it.

--
David Wilkinson
Visual C++ MVP
.