answersLogoWhite

0

methods and variables inside the structure is callled structure member

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering

What is a compression member of a structure?

column


What is a tension member of a structure?

stacture beam............


Are structures and pointers related in c plus plus?

Not really, but you can have: - a pointer pointing to a structure (FILE * is an example) - a pointer pointing to a structure-member (eg: struct tm tm; int *ip= &tm.tm_year) - a structure-member that is a pointer (any type) Example: typedef struct TreeNode { struct TreeNode *left, *right; int data; } TreeNode; TreeNode *root = (TreeNode *)calloc (sizeof (TreeNode), 1);


What is data structure why is an array called a data structure which are the other data structures?

A data structure is a collection of more than one elementary item, in some kind of aggregate organization. An array is a type of structure where more than one item of the same type are arranged serially in memory, and accessed using an index. The item can either be an elementary type or it itself can be a structure type. A struct (not to be confused with the use of "structure" in this answer) is a type of structure where more than one item of the same or different types are arranged serially in memory, and accessed using the structure member (.) operator. A union is similar to a struct, except that each member occupies the same address. This means that only one type of data can be stored at any one time in a union. A self-referential structure is a type of structure, usually constructed of simpler structures, linked together with some kind of pointer scheme. Examples of this are the linked list and tree.


What is the recursive solution in data structure?

You cannot have recursion within a data structure: struct foo { int x; foo y; // compiler error }; This has to fail; there is no end point to the recursion. If a foo is member of a foo, then the member foo also requires a member foo, and so on to infinity... If a structure needs to refer to another instance of itself, we can use a member pointer: struct foo { int x; foo* y; // ok }; A pointer works because all pointers are the same length regardless of the pointer's type (the type being referred to). Using member pointers like this is fundamental to many data structures, such as linked lists: struct node { int data; node* prev; // previous node in the sequence (may be NULL) node* next; // next node in the sequence (may be NULL) };