Solved

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

Posted on 2008-06-19
5
294 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Or at least that’s the word according to a new blog from Tech Target on AWS’s new Managed Services (MS) offering. According to the blog, AWS is launching their AWS MS program to expedite the adoption of cloud by Fortune 1000 and Global 2000 companie…
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

756 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