No, they are completely relevant in C. Remember, the stdio package, which typically relies on null terminated strings, is NOT part of C. It is simply a char array modification and analysis package which includes some sys calls.
I can do:
Code:
char* buff[3];
buff[0] = 'A';
buff[1] = 'B';
buff[2] = 'C';
int size_of_buff = 3;
And can do everything I do with NULL terminated strings and the stdio package, with standard C code. They are NOT irrelevant in C. That's a completely false statement. They are irrelevant and/or hazardous as far as the stdio package goes, 'tis is all. It's just an external library. Not part of the language.
I'm aware that the buffer was too small, I thought we established that.
No, I was simply being as petty to you as you were being to me. You know damn well that it illustrated my point just fine without being a dick about it. If you are to be a dick about it, then I'll be a dick about it and say that most systems are 4 byte word addressable, therefore the issue wouldn't be shown in that example.
First, you're not sorry, please don't bull........ me. Secondly, although what I posted isn't guaranteed to work; due to system standards, it would most likely be OK to use the code I showed, although I would never say it's legit to overflow a buffer. I was NOT posting the code for him to copy/paste, I was simply showing him a concept, simple as that.
I'll edit the post above to be an array of size 15. That should clarify any ambiguities regarding buffer overflows, so people like you will get off my back.
I'm trying to help people by teaching concepts, not get dicked on details by people like you because it's not syntactically correct.
The code I wrote, regardless of it being correct in terms of exact syntax, works on a C2D compiled with gcc4.2.1 with both static and dynamic allocation perfectly fine - just tested. That's the contrary to your "
the only thing you'll get is a bug" statement.
Again, I was showing a concept, not code for him to write down. I was simply trying to illustrate what the buffer variable was.