How can I implement opaque (abstract) data types in C?
What's the difference between these two declarations?

struct x1 { ... };
typedef struct { ... } x2;

Answers were Sorted based on User's Feedback



How can I implement opaque (abstract) data types in C? What's the difference between these two..

Answer / phani kumar s

using the structures and the pointers
n structures the memory will be allocated for each object at
different locations struct x1 { ... };

Is This Answer Correct ?    4 Yes 0 No

How can I implement opaque (abstract) data types in C? What's the difference between these two..

Answer / 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

More C Interview Questions

can i know the source code for reversing a linked list with out using a temporary variable?

6 Answers   Honeywell,


What are the different types of errors?

0 Answers  


Why is it that not all header files are declared in every C program?

0 Answers  


What are static variables in c?

0 Answers  


What is your stream meaning?

0 Answers  






What is #include conio h?

0 Answers  


What is a ternary operator in c?

0 Answers  


What is keyword with example?

0 Answers  


How do we swap or interchange any 2 numbers without using Temporary variable...Anybody can pls answer it.. Thanks in Advance

8 Answers  


What is difference between union All statement and Union?

0 Answers  


What is the modulus operator?

0 Answers  


What is define directive?

0 Answers  


Categories