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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:03:53+00:00 2026-05-13T14:03:53+00:00

I want to ask about the fundamental data types in Objective-C on iOS. I

  • 0

I want to ask about the fundamental data types in Objective-C on iOS.

I need the size on which the variable is represented and the range of the variable.
So in example:
short int – 2 bytes – signed: -32768 to 32767 and unsigned: 0 to 65535
This is only an example.

  • 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-13T14:03:54+00:00Added an answer on May 13, 2026 at 2:03 pm

    This is a good overview:

    http://reference.jumpingmonkey.org/programming_languages/objective-c/types.html

    or run this code:

    32 bit process:

      NSLog(@"Primitive sizes:");
      NSLog(@"The size of a char is: %d.", sizeof(char));
      NSLog(@"The size of short is: %d.", sizeof(short));
      NSLog(@"The size of int is: %d.", sizeof(int));
      NSLog(@"The size of long is: %d.", sizeof(long));
      NSLog(@"The size of long long is: %d.", sizeof(long long));
      NSLog(@"The size of a unsigned char is: %d.", sizeof(unsigned char));
      NSLog(@"The size of unsigned short is: %d.", sizeof(unsigned short));
      NSLog(@"The size of unsigned int is: %d.", sizeof(unsigned int));
      NSLog(@"The size of unsigned long is: %d.", sizeof(unsigned long));
      NSLog(@"The size of unsigned long long is: %d.", sizeof(unsigned long long));
      NSLog(@"The size of a float is: %d.", sizeof(float));
      NSLog(@"The size of a double is %d.", sizeof(double));
    
      NSLog(@"Ranges:");
      NSLog(@"CHAR_MIN:   %c",   CHAR_MIN);
      NSLog(@"CHAR_MAX:   %c",   CHAR_MAX);
      NSLog(@"SHRT_MIN:   %hi",  SHRT_MIN);    // signed short int
      NSLog(@"SHRT_MAX:   %hi",  SHRT_MAX);
      NSLog(@"INT_MIN:    %i",   INT_MIN);
      NSLog(@"INT_MAX:    %i",   INT_MAX);
      NSLog(@"LONG_MIN:   %li",  LONG_MIN);    // signed long int
      NSLog(@"LONG_MAX:   %li",  LONG_MAX);
      NSLog(@"ULONG_MAX:  %lu",  ULONG_MAX);   // unsigned long int
      NSLog(@"LLONG_MIN:  %lli", LLONG_MIN);   // signed long long int
      NSLog(@"LLONG_MAX:  %lli", LLONG_MAX);
      NSLog(@"ULLONG_MAX: %llu", ULLONG_MAX);  // unsigned long long int
    

    When run on an iPhone 3GS (iPod Touch and older iPhones should yield the same result) you get:

    Primitive sizes:
    The size of a char is: 1.                
    The size of short is: 2.                 
    The size of int is: 4.                   
    The size of long is: 4.                  
    The size of long long is: 8.             
    The size of a unsigned char is: 1.       
    The size of unsigned short is: 2.        
    The size of unsigned int is: 4.          
    The size of unsigned long is: 4.         
    The size of unsigned long long is: 8.    
    The size of a float is: 4.               
    The size of a double is 8.               
    Ranges:                                  
    CHAR_MIN:   -128                         
    CHAR_MAX:   127                          
    SHRT_MIN:   -32768                       
    SHRT_MAX:   32767                        
    INT_MIN:    -2147483648                  
    INT_MAX:    2147483647                   
    LONG_MIN:   -2147483648                  
    LONG_MAX:   2147483647                   
    ULONG_MAX:  4294967295                   
    LLONG_MIN:  -9223372036854775808         
    LLONG_MAX:  9223372036854775807          
    ULLONG_MAX: 18446744073709551615 
    

    64 bit process:

    The size of a char is: 1.
    The size of short is: 2.
    The size of int is: 4.
    The size of long is: 8.
    The size of long long is: 8.
    The size of a unsigned char is: 1.
    The size of unsigned short is: 2.
    The size of unsigned int is: 4.
    The size of unsigned long is: 8.
    The size of unsigned long long is: 8.
    The size of a float is: 4.
    The size of a double is 8.
    Ranges:
    CHAR_MIN:   -128
    CHAR_MAX:   127
    SHRT_MIN:   -32768
    SHRT_MAX:   32767
    INT_MIN:    -2147483648
    INT_MAX:    2147483647
    LONG_MIN:   -9223372036854775808
    LONG_MAX:   9223372036854775807
    ULONG_MAX:  18446744073709551615
    LLONG_MIN:  -9223372036854775808
    LLONG_MAX:  9223372036854775807
    ULLONG_MAX: 18446744073709551615
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to ask about this function in matlab dicomread example : a =
I want to ask a question about the Contacts on objective C. I am
I don't know too much about encryption, I just want to ask, which method
I want to ask about the NSArray in objective C. I want to create
I want to ask about the objective C question. I want to create a
I want to ask about the iPhone application objective C problem. I wrote a
I want to ask about the iPhone application and objective C question. In the
I want to ask about how to store data retrieved from a cursor object
I want to ask about the passing parameter in objective C on iPhone simulator.
I want to ask about strcpy. I got problem here. Here is my code:

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.