answersLogoWhite

0

Structure in c

Updated: 8/9/2023
User Avatar

Wiki User

13y ago

Best Answer

Structures are a way of storing many different values in variables of potentially different types under the same name. This makes it a more modular program, which is easier to modify because its design makes things more compact. Structs are generally useful whenever a lot of data needs to be grouped together--for instance, they can be used to hold records from a database or to store information about contacts in an address book. In the contacts example, a struct could be used that would hold all of the information about a single contact--name, address, phone number, and so forth.
->A structure is a collection of related elements , possibly of different types , having a single name.

->"each element in a structure is called field".

->A FIELD is a smallest element of named data that has meaning. It has many characteristics of the variable .

->It exits in memory . it can be assigned values, which in turn can be accessed for selection or manipulation.

-> A field differs form variable primarily in that it is a part of structure.

ITS SYNTAX IS:

struct tag name

{

field list;

};

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

a structure is like an array in that array(derived data type) is a collection of variables of similar datatypes whereas a structure(user defined data type) is a collection of variables of different data types

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

A structure (from now on called struct), is a list of several ODT (old data types).

I can have a structure that keeps track of, let's say my user info:

struct User {

char Username[256];

int TimeOn;

};

Note the semicolon.

Now, you can access structs by declaring a variable of struct User.

struct User UserOne;

UserOne.Username = "Bob";

UserOne.TimeOne = 0;

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

in arrays we can create number of variables in same data types but in structure we can create our own data types..

EXAMPLE:

typedef struct

{

int id;

char name[36];

int sal;

}emp;

in that above example we create emp data type it use 40 bytes of memory space.

This answer is:
User Avatar

User Avatar

Wiki User

8y ago

Structures in C are user defined data types. They can hold a number of values but all must be of the same type.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

data structure in c means data structure through c language but data structure means data structure through all programming languages like c, c++ and jawa etc.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

i don't know what is data structure but say that data structure is vary importent in our life

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

dutyutyityi

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Structure in c
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the structure of carbon sub-oxide?

Formula is C3O2, structure is:O=C=C=C=O


What do you mean by non primitive data structure in C programming?

What do you mean by searching in data structure in C.?


Basic control structure available in c plus plus?

The basic control structure in C++ is the if statement.


Why does the structure H-C equals C-H fail to make sense chemically?

because of their structure


What is structure and union?

Structure is a query that is used in language c++


How do you create modules in c language?

by using structure in c.........


A b c d side of structure?

The a b c d side of a structure at an incident are the exposures or surrounding properties


Is it true that C-O-C is the general structure for ether?

Yes..


Which purpose structure is using in c?

structure is a collection of variables of different datatypes.


Lewis dot structure of acetylene?

Either one can be drawn for C2H6O. They both mean the same thing.


What is the structure for SCN?

with 16 valence electrons it is a linear structure. lS = C = Nl


What is the structure of the DNA loop?

A to T, T to A, G to C, C to G