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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:27:27+00:00 2026-05-22T01:27:27+00:00

The C standard guarantees that an int is able to store every possible array

  • 0

The C standard guarantees that an int is able to store every possible array size. At least, that’s what I understand from reading §6.5.2.1, subsection 1 (Array subscripting constraints):

One of the expressions shall have type ‘‘pointer to object type’’, the other expression shall
have integer type, and the result has type ‘‘type’’.

Since we shall use ints as array subscripts, why are we supposed to use size_t to determine the size of an array?

Why does strlen() return size_t when int would suffice?

  • 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-22T01:27:28+00:00Added an answer on May 22, 2026 at 1:27 am

    The term “integer type” doesn’t mean int – for example, char, and short are integer types.

    Just because you can use an int to subscript an array doesn’t necessarily mean that it can reach all possible array elements.

    More specifically about size_t vs. int, one example would be platforms where int might be a 16-bit type and size_t might be a 32-bit type (or the more common 32-bit int vs 64 bit size_t difference on today’s 64-bit platforms).

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

Sidebar

Related Questions

I know that the C++ standard explicitly guarantees the size of only char ,
If I have a union, C standard guarantees that the union itself will be
Does the standard guarantee that order of equal elements will not change (eh, forgot
The standard explicitly states that main has two valid (i.e., guaranteed to work) signatures;
Standard Entry Sequence : _function: push ebp ;store the old base pointer mov ebp,
In standard ASP.net applications ASP.net offered some protection from XSS attacks with validateRequest throwing
The standard model has been that OpenGL is for professional apps (CAD) and Direct3D
Using standard mysql functions is there a way to write a query that will
Are there any guarantees that realloc() will always shrink a buffer in-place?? So that
Challenge The shortest program by character count that accepts standard input of the form

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.