Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Explain why this prints the same
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Dik T. Winter, post: 2439459"] Ok, let's see: Well, for a a segment of 9 integers is allocated succesively filled with the integers 1 to 9. As 'a' in this context is a pointer to an array of three ints, you are lying to the compiler. The result is (I think) undefined behaviour. And more so. Here the result is certain to be undefined behaviour. And this is the third time you are lying. You are lucky that sizeof(int) == sizeof(*int) on your system. Because on your system sizeof(int) == sizeof(*int) and the compiler disregards all those lies. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Explain why this prints the same
Top