How do you write code compatible with 32-bit and 64-bit?

What considerations do I need to do if I want my code to work correctly on both 32-bit and 64-bit platforms?

EDIT: Which areas should I observe, for example? printing lines / characters or using structures?

0
source share
9 answers

Parameters:

Enter the code in any language using a virtual machine (e.g. Java)

Enter the code in .NET and don’t target any particular architecture. The .NET JIT compiler will compile it for you in the correct architecture before running.

+2
source

, ( , Java .Net ).

.

, ?

+1

, , , :)

mozilla C faq

+1

, ? , 32- .

0

- , 32- .

"-" . , - "C" "++" - , .. - .

0

, , # Java Scripting, JavaScript, Python PHP, -, , .

, , ++, C .

, , , 32- 2 ^ 32, 64- 2 ^ 64.

64- , . , , 32, 64, , 32- .

0

C (, , ++) sizeof malloc. , , 64- .

0

, , . ( , , , , , .)

, , , - , , , . , , , , .

0

, , , "int" ( ).

typedefs - , , 8- 64- , , C int .

- , - - , - , , , ( typedef.h ).

0

All Articles