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 the sizeof () a pointer?
what type of language is C?
How to write c functions that modify head pointer of a linked list?
how to find out the biggest element (or any other operation) in an array which is dynamic. User need not to mention the array size while executing.
write a program which will count occurance of a day between two dates.
What is define directive?
what is default constructor?
HOW DO YOU HANDLE EXCEPTIONS IN C?
how can i make a program with this kind of output.. Enter a number: 5 0 01 012 0123 01234 012345 01234 0123 012 01 0
enum { SUNDAY, MONDAY, TUESDAY, }day; main() { day =20; printf("%d",); getch(); } what will be the output of the above program
Define recursion in c.
What will be printed as the result of the operation below: #include<..> int x; int modifyvalue() { return(x+=10); } int changevalue(int x) { return(x+=1); } void main() { int x=10; x++; changevalue(x); x++; modifyvalue(); printf("First output:%d\n",x); x++; changevalue(x); printf("Second output:%d\n",x); modifyvalue(); printf("Third output:%d\n",x); }