answersLogoWhite

0

A structure is defined by using the 'struct' keyword, followed by all of the field definitions inside a block. For example:

struct

{

char field1 ;

int field2 ;

} myStruct ;

This defines a new struct and creates one called myStruct, with the fields that you see inside the block. There are different ways of describing a struct, such as:

struct x {int a; int b; int c;}; /* declaration */
struct {int a; int b; int c;} z;
struct x z;

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How do you define the structure size in C language?

You cannot define the size of the structure, but you can query it with sizeof.The structure size in C language depends on the elements of the structure.Example:#include struct Test{int v;char str[100];};int main(){printf("The structure size is %d\n", sizeof(struct Test));return 0;}


Define C as an object oriented language?

Don't.


Define a complex number using c structure?

Just define two fields (whatever those are called in "C" - the parts of the structure), one for the real part, one for the imaginary part.Just define two fields (whatever those are called in "C" - the parts of the structure), one for the real part, one for the imaginary part.Just define two fields (whatever those are called in "C" - the parts of the structure), one for the real part, one for the imaginary part.Just define two fields (whatever those are called in "C" - the parts of the structure), one for the real part, one for the imaginary part.


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.........


Can you define a function within a structure?

No, it is the other way around: you can define a structure within a function.In C++ though, structs are actually classes, so they can have methods.


What is a formatting language that marks text with a set of tags that define the structure and behavior of a Web document?

The body element indicates structure and content.


Why is c called a structured language?

a synonym for structure language in "Comb-sturctured" languages. C in comb.


How can define date data type in c structure?

struct tm can be an example.


Define the role of printf and scanf in c language?

to write and read the values


What is preprocessor derective in C language?

#if, #define, #include just to name a few


When you can use percent D in c language?

To define any integer type value.