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

How is a structure member accessed?

1185


Define Spanning-Tree Protocol (STP)

1176


What is ## preprocessor operator in c?

1128


How can you be sure that a program follows the ANSI C standard?

1654


What is double pointer in c?

1087


How can you invoke another program from within a C program?

1117


typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none

1239


What is the difference between test design and test case design?

2130


What is the difference between array and structure in c?

1238


how to find anagram without using string functions using only loops in c programming

3231


What does sizeof int return?

1132


What is c programing language?

1130


Which built-in library function can be used to match a patter from the string?

1347


Why do we use int main?

1142


What is table lookup in c?

1144