Timeline for Is my OS 32-bit or 64-bit?
Current License: CC BY-SA 3.0
17 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 23, 2017 at 1:14 | comment | added | Dinaiz | Sorry to say that but sizeof is evaluated at compile time. So if you compile a 32 bit exe and run it on a 64 bit machine, it will ouput 32 while it should output 64 (stackoverflow.com/questions/2615203/…). Nice idea though ! | |
Jun 22, 2017 at 12:16 | comment | added | Klas Lindbäck | @DavidSchwartz "You can assume that users will use 64 bit software whenever possible." | |
Jun 21, 2017 at 23:24 | comment | added | David Schwartz | This doesn't comply with the requirements. "Please note that a 32 bit program running on a computer with a 64 bit operating system should output "64"." This tells you how the program was compiled, not what the OS is. | |
Jun 21, 2017 at 6:06 | comment | added | k_g | Since this only needs to work on some systems, can you just assign the result to a variable (so it's on top of the stack) instead of returning it? | |
Jun 20, 2017 at 12:05 | history | undeleted | Govind Parmar | ||
Jun 20, 2017 at 8:15 | history | deleted | Govind Parmar | via Vote | |
Jun 20, 2017 at 5:48 | comment | added | phuclv |
it also won't work if CHAR_BIT != 8
|
|
Jun 20, 2017 at 5:30 | comment | added | ceilingcat |
@KenY-N, you're right; this returns 32 when compiled with the -mx32 option in gcc. x32 mode is only available on x86_64 processors.
|
|
Jun 20, 2017 at 4:35 | comment | added | Ken Y-N | Isn't that going to depend on whether you compile as a 32 or 64 bit program? | |
Jun 19, 2017 at 21:47 | comment | added | Govind Parmar | @Dennis Well in that case thanks for the tip! | |
Jun 19, 2017 at 21:47 | history | edited | Govind Parmar | CC BY-SA 3.0 |
added 17 characters in body
|
Jun 19, 2017 at 21:42 | comment | added | Dennis | It also says that the usual code golf rules apply, and returning from a function is part of our defaults for I/O. | |
Jun 19, 2017 at 21:41 | comment | added | Govind Parmar | @Dennis the challenge specifically says"print" in the OP | |
Jun 19, 2017 at 21:40 | comment | added | Dennis |
No need for printf , you can simply return the integer.
|
|
Jun 19, 2017 at 21:23 | history | edited | Govind Parmar | CC BY-SA 3.0 |
edited body
|
Jun 19, 2017 at 21:15 | history | edited | Govind Parmar | CC BY-SA 3.0 |
deleted 2 characters in body
|
Jun 19, 2017 at 21:06 | history | answered | Govind Parmar | CC BY-SA 3.0 |