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 |
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
Difference between linking and loading?
How old is c programming language?
What is indirection in c?
Write the following function in C. stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return - 1. The function should not make use of any C library function calls.
3 Answers Google, Infosys, JTL, OpenFeel,
Does c have an equivalent to pascals with statement?
what is pointer?
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)
main() { int i = 1; int num[] = {1,2,3,4}; num[i] = i++; printf("%d", num[i]); } what will be the output? }
22 Answers NDS, TCS,
What is pointers in c?
hOW Can I add character in to pointer array of characters char *a="indian"; ie I want to add google after indian in the char *a
How is pointer initialized in c?