Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Why pointers are used?

1026


What is the significance of scope resolution operator?

1362


What is a method in c?

1077


given post order,in order construct the corresponding binary tree

2743


Tell me with an example the self-referential structure?

959


Why we use void main in c?

1112


What does the && operator do in a program code?

1167


Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

1045


What are the benefits of c language?

1123


What is #define?

1051


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

1101


What is data structure in c and its types?

1031


what is the basis for selection of arrays or pointers as data structure in a program

4262


In C, What is the #line used for?

2118


Explain enumerated types in c language?

1000