User talk:Dampam
Welcome!
Hello, Dampam, and welcome to Wikipedia! Thank you for your contributions. I hope you like the place and decide to stay. Here are some pages that you might find helpful:
- The five pillars of Wikipedia
- Tutorial
- How to edit a page
- How to write a great article
- Manual of Style
I hope you enjoy editing here and being a Wikipedian! Please sign your messages on discussion pages using four tildes (~~~~); this will automatically insert your username and the date. If you need help, check out Wikipedia:Questions, ask me on my talk page, or ask your question on this page and then place {{helpme}}
before the question. Again, welcome! RJFJR (talk) 15:31, 10 July 2008 (UTC)
malloc
Please stop reverting my changes to this article; if you think they are incorrect please explain and fix only those parts which are incorrect - "learn C" is not a suitable justification, particularly from someone who thinks realloc(ptr, 0) is the same as free(ptr). NicM (talk) 06:14, 22 July 2008 (UTC).
- You may want to take a look at the C99 draft 7.20.3.4, there is no mention of the behaviour you describe (returning NULL when size == 0); you can confirm this as implemented on some systems - realloc(ptr, 0) will return a pointer, not NULL. NicM (talk) 06:41, 22 July 2008 (UTC).
Also, I had another look at the C99 draft, and I can't see where ptr = 0; printf("%p", (void *) ptr); is UB. The printf section clearly says the pointer representation is converted in an implementation-defined manner (without any caveats about NULL) and I don't see anything about varardics to make it UB (although I could be missing it). I have removed this line from the article until you confirm with a cite - it is unobvious so we will probably want to add the cite to the article, so an online link would be best if possible. NicM (talk) 06:41, 22 July 2008 (UTC).