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
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 |
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 |
What is getch() function?
In the following control structure which is faster? 1.Switch 2.If-else and which consumes more memory?
Is a house a mass structure?
write a program for egyptian fractions in c?
can any one tell that i have a variable which is declared as static but i want this variable to be visible to the other files? how?
how can i get output the following... 5 4 3 2 1 4 3 2 1 3 2 1 2 1 1 and 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 plz plz...
What is the argument of a function in c?
Why cant I open a file by its explicit path?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
Why do we need arrays in c?
What are the advantages of union?
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none