How can I implement opaque (abstract) data types in C?
What's the difference between these two declarations?
struct x1 { ... };
typedef struct { ... } x2;
Answer Posted / pankaj
Abstract data type in C can be implemented using structures :
struct abstract;
typedef struct abstract abstract_type;
Note that this didn't define the struct abstract fully, only an opaque struct. sizeof() can be used on it. Memory can be allocated by using some macros and typecasted into this type.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Why pointers are used?
What is the significance of scope resolution operator?
What is a method in c?
given post order,in order construct the corresponding binary tree
Tell me with an example the self-referential structure?
Why we use void main in c?
What does the && operator do in a program code?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What are the benefits of c language?
What is #define?
a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if
What is data structure in c and its types?
what is the basis for selection of arrays or pointers as data structure in a program
In C, What is the #line used for?
Explain enumerated types in c language?