Out-of-bounds nonsense

  • Thread starter Frederick Gotham
  • Start date
F

Frederick Gotham

Herbert Rosenau:
May result in udefined behavior when Type1 != Type2 as the
representation of different types does not require that they are have
to have the same padding bits adn/or alignment requirements.


Not that we don't access "obj1" subsequent to the copy. Therefore, all
behaviour is well-defined.

memcpy can fail in the lands of udefined behavior here.


No, it can't.

Accessing obje1 thereafter can end in anything but may not do what you
thinks it should do.


Indeed, one would exercise caution if going on to access "obj1".
 
F

Frederick Gotham

Mark McIntyre:
Its type is int[2][2].

*sigh*.

No, thats its declaration.
Its type is array two of array two of int.

I prefer the name:

Eagar dhá dhúil, ar eagar dhá int gach dúil.

, but then again, we can call it whatever we like. The Standard seems to call
it an:

int[2][2]
 
M

Mark McIntyre

Mark McIntyre:
Its type is int[2][2].

*sigh*.
The Standard seems to call
it an:

int[2][2]

Nope.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 

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
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top