Is there Data Abstraction in C Language?
This was the question I was asked during my project review but still I am clueless about the answer.
The question was, Is there Data Abstraction in C Language? I answered them No. Then, they asked me What is Structure and Union?. I told them, A structure is a collection of variables under a single name. These variables can be of different types, and each has a name which is used to select it from the structure. A structure is a convenient way of grouping several pieces of related information together. Now they asked me, If that is the case then how can we say that there is no Data abstraction in C? I was totally speechless at this. Still now, I don't have the answer for it.
If you guys can help me explain me this, it would be of great help to me. Thank you very much!
The reply to your question
Quote:
Originally Posted by
laserlight
To phrase the question in a more open ended way: what is data abstraction? Provide an example.
Data Abstraction is organizing access to a program's data (eg.) arranging variable declarations and methods for accessing data.
So, what do you say now?
data abstarction is there in C and highly used.
So finally, the answer to the question "Can we have data abstraction in C?" is YES.
The data type like Stack, Queue...etc are perfect examples of data abstraction and those all are well implemented in C.
In C++, we achieve data abstraction through "Class".
This link might help you:
http://www.itmweb.com/essay550.htm