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
Where local variables are stored in c?
What is c variable?
How are structure passing and returning implemented?
Write a program to print all permutations of a given string.
What is void pointers in c?
about c language
How can I ensure that integer arithmetic doesnt overflow?
Explain the use of function toupper() with and example code?
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???
How can I do peek and poke in c?
What is s or c?
Why isnt there a numbered, multi-level break statement to break out
I have a varargs function which accepts a float parameter?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
What does 3 mean in texting?