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

Forum statistics

Threads
474,079
Messages
2,570,574
Members
47,205
Latest member
ElwoodDurh

Latest Threads

Top