KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
The following little program is very awkward using GCC version 4.2.1 (Apple Inc. build 5664) on a Mac. #include <stdio.h> int main(){ int x = 1 << 32; int y = 32; int z = 1 << y; printf("x:%d, z: %d\n", x, z); } The result is x:0, z: 1 . Any idea why the values of x and z are different? Thanks a lot.
Tags (comma-separated)
Save Edits
Cancel