Solved

32-bit build & 64-bit build/ C++

Posted on 2008-06-19
5
266 Views
Last Modified: 2013-12-09
Hello
I have seen many C/C++ applications which has seperate build code for 32-bit and 64-bit machine.

May i know, the genuine reason for coming up with different build code for different bit size?

Regards
Sham
0
Comment
Question by:sham_ibmgs
5 Comments
 

Author Comment

by:sham_ibmgs
ID: 21820470
I have seen a security application, which has different builds, i cannot name it

Regards
Sham
0
 
LVL 45

Accepted Solution

by:
Kdo earned 100 total points
ID: 21821541
Hi Sham,

There are several reasons, among them:

-  64 bit code takes advantage of the 64-bit instructions.  This is largely a compiler issue, but code sometimes migrates to look more native.

#ifdef (INT_IS_64_BITS)
  int     IntValue;
#else
  __int64   IntValue;
#endif

-  64 bit code takes advantage of the 64-bit APIs, especially system interface calls.

-  Some file handling is per-force different with 32 and 64 bit systems.  The ff_blk structure (used with many of the I/O functions) is a 32 or 64-bit structure depending on the O/S.  On a 32-bit O/S, direct access (seek) to a position in a file is limited to to first 2GB.  The code would have to utilize some strange looking techniques to perform I/O at locations higher than 2GB, while it would be transparent on a 64-bit O/S.


Kent
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Introduction: When a connection to the internet is established, there always exists a modem between the connected device and the ISP (Internet Service Provider). The Operating System (OS) on your PC controls the modem which communicates with the …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now