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 175275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:40:12+00:00 2026-05-11T13:40:12+00:00

When I do sizeof(int) in my C#.NET project I get a return value of

  • 0

When I do sizeof(int) in my C#.NET project I get a return value of 4. I set the project type to x64, so why does it say 4 instead of 8? Is this because I’m running managed code?

  • 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. 2026-05-11T13:40:13+00:00Added an answer on May 11, 2026 at 1:40 pm

    There are various 64-bit data models; Microsoft uses LP64 for .NET: both longs and pointers are 64-bits (although C-style pointers can only be used in C# in unsafe contexts or as a IntPtr value which cannot be used for pointer-arithmetic). Contrast this with ILP64 where ints are also 64-bits.

    Thus, on all platforms, int is 32-bits and long is 64-bits; you can see this in the names of the underlying types System.Int32 and System.Int64.

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

Sidebar

Related Questions

For example: sizeof(char*) returns 4. As does int* , long long* , everything that
Why does the sizeof operator return a size larger for a structure than the
Recently saw someone commending another user on their use of sizeof var instead of
In C++, sizeof('a') == sizeof(char) == 1 . This makes intuitive sense, since 'a'
I have been working on an open source project for awhile, http://gtkworkbook.sourceforge.net/ , and
Is the sizeof(enum) == sizeof(int), always ? Or is it compiler dependent? Is it
On a 64-bit machine is the size of an int in Java 32 bits
I'm reading The C++ Programming Language. In it Stroustrup states that sizeof(char) == 1
The following code prints 20, i.e. sizeof(z) is 20. #include <iostream.h> class Base {
How to find out size of session in ASP.NET from web application?

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.