Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is an object in C?

Tags:

I'm not talking about object in C++ nor Objective C. I am trying to understand what "object" means in the context of this text:

If the declaration of a file-scope identifier for an object or a function contains the storage-class-specifier static, the identifier has internal linkage. Otherwise, the identifier has external linkage. See Storage Classes for a discussion of the storage-class-specifier nonterminal.

Within one translation unit, each instance of an identifier with internal linkage denotes the same identifier or function. Internally linked identifiers are unique to a translation unit.

I have already seen the word "object" in other different C topics. But when I Google it, I only get references to C++.

I read it also here and here.

like image 700
user3646717 Avatar asked Oct 27 '14 04:10

user3646717


People also ask

What is object in C language?

In terms of C programming, an object is implemented as a set of data members packed in a struct , and a set of related operations. With multiple instances, the data for an object are replicated for each occurrence of the object.

What is an object in C explain with example?

In C++, Object is a real world entity, for example, chair, car, pen, mobile, laptop etc. In other words, object is an entity that has state and behavior. Here, state means data and behavior means functionality.

What is an object with example?

What Is an Object? (with Examples) An object is a noun (or pronoun) that is acted upon by a verb or a preposition. There are three kinds of object: Direct Object (e.g., I know him.) Indirect Object (e.g., Give her the prize.)


1 Answers

The term object is defined by the C11 Standard section 3.15:

object

region of data storage in the execution environment, the contents of which can represent values

The text on your MSDN link is copy-pasted (without attribution!) from section 6.2.2/3 of the C11 Standard.

To interpret this definition, region of data storage is the key part. All variables are objects, and objects may also be allocated via malloc.

like image 92
M.M Avatar answered Sep 20 '22 21:09

M.M