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
How many identifiers are there in c?
What are the different properties of variable number of arguments?
What is use of null pointer in c?
What is scope rule of function in c?
How can I read in an object file and jump to locations in it?
differentiate built-in functions and user – defined functions.
why we wont use '&' sing in aceesing the string using scanf
Explain c preprocessor?
How do I create a directory? How do I remove a directory (and its contents)?
Explain goto?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
What is typedef?
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above
What is a floating point in c?
How many parameters should a function have?