Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9133425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:29:13+00:00 2026-06-17T08:29:13+00:00

Is there a 64 bit type that in every OS(32/64 bit) and for every

  • 0

Is there a 64 bit type that in every OS(32/64 bit) and for every compiler has a size of 64?

The same question is also for 32 bit type. (It should be int?)

The origin of the question is : I am implementing the system which has 2 kinds of instructions :

  1. 32 bit
  2. 64 bit

I want to write something like:

typedef int instruction32bit;

typedef long long instruction64bit //it is not correct some system have sizeof(long long) = 128 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:29:14+00:00Added an answer on June 17, 2026 at 8:29 am

    If you want your code to be truly portable, then you probably want to typedef your own type, and use for example

       typedef int32_t instruction32bit;
       typedef int64_t instruction64bit;
    

    This will work MOST of the time, but if it doesn’t for a particular system/compiler/whatever, you can add do something like this:

     #ifdef SOMEDEFINE
       typedef long long int instruction64bit;
       typedef int instruction32bit;
     #else
       typedef int32_t instruction32bit;
       typedef int64_t instruction64bit;
     #endif
    

    Of course, for each model of compiler/OS (or group thereof) that doesn’t support int32_t and int64_t, you probably will need a special #ifdef.

    This is exactly what all truly portable code does, because no matter how much you find that “nearly all compilers do X”, if you get your code popular enough, there’s always someone who wants to compile the code with “Bob’s Compiler Project” which doesn’t have this feature. Of course, the other thing is to just leat those who use “Bob’s compiler” edit the typedef itself, and not accept the “For Bob’s compiler, you need this …” patch that inevitably gets sent your way.

    As Carl Norum points out in a comment, the #ifdef may be possible to convert to a #if in many cases, and then use generic types such as int and long.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a function in c# that takes two 32 bit integers (int) and
is there a possible bit of code (php, java, css, html) that will force
I'm looking at http://hseeberger.wordpress.com/2010/11/25/introduction-to-category-theory-in-scala/ and there's a bit of code that I can't understand
Bit of an odd question but is there a way of seeing what objects
So it appears that the .NET performance counter type has an annoying problem: it
Work on asp.net vs05. I have three type of value Like:IsDesign,IsPrinting,IsInstall they are bit
There's this very simple bit a code <asp:TextBox ID=txbVipNumber runat=server /> <asp:TextBoxWatermarkExtender ID=tbweVipNumber runat=server
There seems to be quite a bit of folklore knowledge floating about in restricted
With 32 bit floats I think there is something like 2^31 - 1 representable
While there are multiple ways to reverse bit order in a byte, I'm curious

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.