Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 25
    What about a 32 bit executable on a 64 bit machine? Commented Sep 8, 2015 at 14:58
  • 1
    It's also 32 bit. @Ident Commented Jul 8, 2021 at 7:44
  • @Ident Why do you think "32 bit executable on a 64 bit machine, pointer is 32 bit " is wrong? I just compiled a 32bit C program on my 64bit Ubunut, sizeof output is 4 bytes. Commented Aug 10, 2021 at 11:10
  • 3
    @Rick it is about what word size it is compiled or and not about the machine it runs on, so if it is compiled for 32 bit then it will be 32 bit on a 64 machine, which makes the original answer incorrect. Commented Aug 11, 2021 at 12:30
  • Directed here after searching why sizeof(ptr to int) gives me 8 while cout << ptr prints a 6 bytes address. Interesting. Commented Jun 20, 2022 at 2:36