J
jacob navia
Dave said:Undefined behavior in C (N869 7.1.3#2, see also #1 and 7.21.6.1).
Not sure about C++, but at best highly antisocial there.
The compiler did not issue any warning, nor error.
Undefined behavior in C (N869 5.1.2.2.1#1).
That is irrelevant since this is C++
No complaints from the compilerI believe this is a constraint violation in C++, though I'm not
sufficiently familiar with C++ standardese to be sure; in any case it
violates 3.6.1#2 of the draft C++ standard I'm looking at.
No pretending needed; it's neither legal C++ nor legal C.
dave
Maybe. You think that the program would not crash if i would
have written
int main (void) ???
The point I want to convey with this example is that
C++ has basically the same syntax of C in many aspects
and that therefore the problems associated with raw pointer handling
and buffer overflows will happen in C++ too.