Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • An int isn't an object, it's a primitive type. So it's incorrect where you say "int object". Commented Feb 7, 2014 at 20:48
  • 2
    @Gavin: int is a type. An int is an object whose type is int. An int* object or value points to an object of type int -- i.e., to an int object. Commented Feb 7, 2014 at 20:50
  • @KeithThompson I think it depends on your definition of "object". Technically in C, nothing's an object because it's not an object-oriented language. If we were looking at an object-oriented language, there is generally some wrapper class that wraps a primitive type in an object, but int itself would be a primitive type, and wouldn't be an object. Commented Feb 7, 2014 at 20:54
  • 2
    @Gavin: The C standard defines the word "object" as a "region of data storage in the execution environment, the contents of which can represent values". The C++ standard's definition is similar, and has nothing to do with object-oriented programming. Given int n;, int is a type, and n is the name of an object. Commented Feb 7, 2014 at 21:25