Learning C as an existing programmer

T

Tim Rentsch

Rui Maciel said:
With malloc(), if it isn't possible to allocate memory then it returns a
null pointer. Therefore, an allocation failure is detected by testing the
pointer returned by malloc().

Can you point out how you would handle an allocation
failure caused by a VLA?

I have mentioned one particular idea in another thread.
My plan at this point is to start a new thread about it,
most likely in comp.std.c.
If he's talking about malloc() having a standard interface for
detecting allocation failures and VLAs not having such a
mechanism, that's beside the point I was making, since I was
explicitly talking about implementation-specific mechanisms.

This newsgroup is supposed to be about standard C. [snip elaboration]

It is, and what I'm talking about is what the Standard allows;
surely the subject is just as topical as other discussions about
what implementations are allowed to do in various obscure
circumstances. I thought the idea might be interesting to some
people here, which has been borne out by some other responses;
if it isn't interesting to you, please feel free to ignore any
further comments on the matter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top