what is object in c?

The basic unit of data of a running program is an object; and if the program were written in C, then the sizes of objects would vary according to their data types.

So, what is an object? An object can be defined as:

“An object is a contiguous block of memory forming a single logical data structure. Objects are the units of allocation, deallocation, etc., and has a well-defined set of operations.”

Note: We use the term `object’ in a sense introduced by K&R , Objects and Lvalues, which has no relation with Object Oriented Programming.

As per the definition, an object type has a well-defined set of operations that can be applied upon it.  For example, the C language does not allow bit-wise operation on floating types, multiplication on pointer types, and cast operation on lvalues, etc.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: