answersLogoWhite

0


Best Answer

A data structure (declared with the struct keyword) should be used to define a plain-old data type (a POD). A POD is a class, but one that has trivial construction and no invariants or methods (there is no encapsulation). PODs are primarily used for compatibility between C++ and C code, since C has no understanding of objects.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

The C Programming language does not support object oriented programming.

Unless, that is, you take a purist's point of view, like mine, and consider that all programming languages, even assembler, can be treated like object oriented languages if you think of the operations that you can do on an "object" in the right way. That, however, is not mainstream mentality, so the official answer is still no - C is not an OOPL - C++ is - but not C.

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

It is necessary to understand some of the concepts used extensively in object-oriented programming. These include:

• Objects

• Classes

• Data abstraction and encapsulation

• Inheritance

• Polymorphism

• Dynamic binding

• Message passing

Objects

Objects are the basic run time entities in an object-oriented system. They may represent a person, a place, a bank account, a table of data or any item that the program has to handle. They may also represent user-defined data such as vectors, time and lists. Programming problem is analyzed in term of objects and the nature of communication between them. Program objects should be chosen such that they match closely with the real-world objects. Objects take up space in the memory and have an associated address like a record in Pascal, or a structure in c.

When a program is executed, the objects interact by sending messages to one another.

Classes

We just mentioned that objects contain data, and code to manipulate that data. The entire set of data and code of an object can be made a user-defined data type with the help of class. In fact, objects are variables of the type class. Once a class has been defined, we can create any number of objects belonging to that class. Each object is associated with the data of type class with which they are created. A class is thus a collection of objects similar types. For examples, Mango, Apple and orange members of class fruit. Classes are user-defined that types and behave like the built-in types of a programming language. The syntax used to create an object is not different then the syntax used to create an integer object in C. If fruit has been defines as a class, then the statement

Fruit Mango;

Will create an object mango belonging to the class fruit.

Data Abstraction and Encapsulation

The wrapping up of data and function into a single unit (called class) is known as encapsulation. Data and encapsulation is the most striking feature of a class. The data is not accessible to the outside world, and only those functions which are wrapped in the class can access it. These functions provide the interface between the object's data and the program. This insulation of the data from direct access by the program is called data hiding or information hiding.

Abstraction refers to the act of representing essential features without including the background details or explanation. Classes use the concept of abstraction and are defined as a list of abstract attributes such as size, wait, and cost, and function operate on these attributes. They encapsulate all the essential properties of the object that are to be created.

The attributes are some time called data members because they hold information. The functions that operate on these data are sometimes called methods or member function.

Inheritance

Inheritance is the process by which objects of one class acquired the properties of objects of another classes. It supports the concept of hierarchical classification. For example, the bird, 'robin' is a part of class 'flying bird' which is again a part of the class 'bird'. The principal behind this sort of division is that each derived class shares common characteristics with the class from which it is derived as illustrated in fig 1.6.

In OOP, the concept of inheritance provides the idea of re-usability. This means that we can add additional features to an existing class without modifying it. This is possible by deriving a new class from the existing one. The new class will have the combined feature of both the classes. The real appeal and power of the inheritance mechanism is that it.

Polymorphism

Polymorphism is another important OOP concept. Polymorphism, a Greek term, means the ability to take more than on form. An operation may exhibit different behavior is different instances. The behavior depends upon the types of data used in the operation. For example, consider the operation of addition. For two numbers, the operation will generate a sum. If the operands are strings, then the operation would produce a third string by concatenation. The process of making an operator to exhibit different behaviors in different instances is known as operator overloading.

Dynamic Binding

Binding refers to the linking of a procedure call to the code to be executed in response to the call. Dynamic binding means that the code associated with a given procedure call is not known until the time of the call at run time. It is associated with polymorphism and inheritance. A function call associated with a polymorphic reference depends on the dynamic type of that reference.

Message Passing

An object-oriented program consists of a set of objects that communicate with each other. The process of programming in an object-oriented language, involves the following basic steps:

1. Creating classes that define object and their behavior,

2. Creating objects from class definitions, and

3. Establishing communication among objects.

Objects communicate with one another by sending and receiving information much the same way as people pass messages to one another. The concept of message passing makes it easier to talk about building systems that directly model or simulate their real-world counterparts.

A Message for an object is a request for execution of a procedure, and therefore will invoke a function (procedure) in the receiving object that generates the desired results. Message passing involves specifying the name of object, the name of the function (message) and the information to be sent.

Object has a life cycle. They can be created and destroyed. Communication with an object is feasible as long as it is alive.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

Well we can use function pointers to implement most of the OOPs concepts in c, especially the inheritance and polymorphism.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

C is not an object oriented language, and has no concept of an "object."

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Explain the different object based and object oriented concepts in C?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Explain the Abstraction terms in the context of object oriented programming Also explain how these concepts are implemented in C by giving an example program for each?

g terms in the context of object oriented programming


Explain different types of inheritance of object oriented programming?

== ==


Explain the following tearm in the context of object oriented programming Also explain how these concept are implement in c by given an example program for each?

Explain the following terms in the context of object oriented programming. Also explain how these concepts are implemented in C++ by giving an example program for each.


What is an essential of Object Oriented Programming?

The 3 essential concepts of Object Oriented Programming are:InheritanceEncapsulation &Polymorphism


What is the distinct difference between object oriented concept and object oriented programming?

Object oriented concepts are a generalisation of the object oriented principals (encapsulation, inheritance, polymorphism and abstraction) without specifying a particular implementation of those principals. Object oriented programming is the application of those principals through an object oriented programming language.


What three concepts are the basis for object-oriented programming?

Classes, objects and methods are the three concepts for OOP programming.


What is an inheritance Explain different types of inheritance in c?

C is not an object oriented language and therefore has no native support for inheritance.


What is the components of OOPS?

Java is an object oriented programming language. The various object oriented concepts in it are: * Class * Object * Instance * Method * Inheritance * Polymorphism * Abstraction * Encapsulation etc...


Explain the main features or characters of object oriented programming?

adAD


What is object in c sharp?

An object is a type of data structure. It's one of the most basic concepts in object-oriented programming (as you might guess from the name).


What is object concept in visual basic net?

The object concept is visual basic net is a part from a book. There are four key concepts of object-oriented development.


What has the author Rainer Weinreich written?

Rainer Weinreich has written: 'Concepts and techniques for object-oriented software development' -- subject(s): Development, Object-oriented programming (Computer science), Computer software