Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-06-19
5
Medium Priority
?
314 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 46

Accepted Solution

by:
Kent Olsen earned 400 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 September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

721 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