48.9k views
3 votes
Before a structure can be used, it must be

A.
declared

B.
deallocated

C.
initialized

D.
All of the above

User POPI
by
7.6k points

1 Answer

5 votes

Answer:

A. declared

Step-by-step explanation:

Before a structure can be used, it must be declared.

For example:

// Structure definition

struct s{

int a;

char b;

};

// Structure instantiation

struct s mystruct;

// This is where a structure instance called mystruct is created whose

// datatype is struct s.

mystruct.a = 10;

mystruct.b = 'c';

As we can see from the example definition precedes use for the structure.

User Dlackty
by
7.2k points