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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:08:42+00:00 2026-05-16T23:08:42+00:00

C code targeting x64, as has been previously discussed, should always use size_t instead

  • 0

C code targeting x64, as has been previously discussed, should always use size_t instead of int for things like counts and array indexes.

Given that, it would arguably be simpler and less error prone to just standardize on size_t (typedef’d to something shorter) instead of int as the usual integer type across the entire code base.

Is there anything I’m missing? Assuming you don’t need signed integers, and you’re not storing large arrays of small integers (where making them 32 bits instead of 64 bits could save memory), is there any reason to use int in preference to size_t?

  • 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-05-16T23:08:43+00:00Added an answer on May 16, 2026 at 11:08 pm

    I would say in the contrary, I would prefer something where you fix the size of the integers, uint8_t … uint64_t (and sometime soon unit128_t), and these would be the base types. So you will know what you get.

    And other typedef like size_t then aliasing to these. You could then simply inspect the typedef for uintprt_t and deduce your address width, e.g.

    And also, people need signed types for sure.
    But the relation could certainly clarified. Already now in the standard, signed types are sort of deduced from the unsigned types. This could be made explicit by forcing a prefix signed. But for sure the later wouldn’t happen, people are too much emotionally attached to int 🙂

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

Sidebar

Related Questions

When I use a conditional statement targeting IE6 and below with some PHP code
Have there been incompatibilities between Java releases where Java source code/Java class files targeting
It has been 22 years between the initial public release of Perl 1.0 (December
I've got some C code I'm targeting for an AVR. The code is being
I need to exclude some code from the compilation when targeting the .NET 3.5
To embed some IronPython Code into C# I want to use the ScriptEngine using
I'm writing this code in a Console Application targeting the .NET Framework 4 Client
I created a XCode targeting IPhone, I've written a lot of code in the
My render code is written in C++, I am targeting android 1.6. I feel
I've just started compressing file in VB.Net, using the following code. Since I'm targeting

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.