Solved

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

Posted on 2008-06-19
5
301 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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:
Kent Olsen 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Arrow Electronics was searching for a KVM  (Keyboard/Video/Mouse) switch that could display on one single monitor the current status of all units being tested on the rack.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

734 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