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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:11:14+00:00 2026-05-27T18:11:14+00:00

When we write int a; , it doesn’t mean that we are creating an

  • 0

When we write int a;, it doesn’t mean that we are creating an object of class int.

  1. What does it mean?
  2. What is the type of the datatype int in C and C++?
  3. Which header file shows what it is?
  • 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-27T18:11:14+00:00Added an answer on May 27, 2026 at 6:11 pm

    When we write int a;, it doesn’t mean that we are creating an object of class int.

    int a; does indeed create an object in C++. It’s an object of type int with indeterminate value if it has automatic storage duration; or with value 0, if it has static storage duration. But there is no “class int” because int is not a class type.

    int is a:

    • integral type;
    • signed type;
    • arithmetic type;
    • fundamental type;
    • scalar type;
    • standard layout type;
    • trivially copyable type;
    • POD type;
    • trivial type;

    Seems like you got a bit confused in your previous question 🙂

    In int x = 12;, you are creating an object of type int that is named x and has value 12.

    The idea of object in C++ is not the same as in most other languages, and most certainly is not the same as is commonly used in object-oriented programming circles. An object in C++ is a region of storage.

    If something has a type, it’s either an object, a reference, or a function.

    Which header file shows what it is?

    The language simply requires that the type int has to exist and have certain characteristics (like being integral and having a sign). All compilers I know of simply treat all the builtin types specially and that’s why you won’t find a definition for them in the standard library headers. In fact, they can’t provide a definition for them in any header using C++, because the language doesn’t provide any means of defining fundamental types. They could only either:

    • define it as a compound type (which would be wrong); or
    • define it using compiler-specific extensions.

    The builtin types are effectively magic.

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

Sidebar

Related Questions

Write a class ListNode which has the following properties: int value; ListNode *next; Provide
FILE *out=fopen64(text.txt,w+); unsigned int write; char *outbuf=new char[write]; //fill outbuf printf(%i\n,ftello64(out)); fwrite(outbuf,sizeof(char),write,out); printf(%i\n,write); printf(%i\n,ftello64(out));
why this lock test doesn't work ? it's throwing an exception bellow Console.Write that
Is there a way in python to increment int object in place, int doesn't
I'm trying to write some code to convert data from a object type field
I want to write a function that works on any Scala type with a
I know that C++ doesn't specify the order in which parameters are passed to
I'm trying to write some code that reads a file and ignores the line
I'd like to write a C macro which takes this: int foo() { MY_MACRO
How do I write a class so that property and method descriptions are visible

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.