Is the following code correct to create a structure?
struct s1{ ... };

Options
- yes
- no


CORRECT ANSWER : yes

Discussion Board
Explanation-

Syntax of defining structure:

struct structure_name
{
data_type member1;
data_type member2;
.
.
data_type memeber;
};

Sapna Tongase 03-8-2017 10:54 PM

Structure

Answer : yes.

Structure is the collection of variables of different types under a single name for better handling.

Example :

typedef struct complex
{
int imag;
float real;
}
comp;

Inside main:
comp c1,c2;


Jayesh Sonar 02-24-2015 02:36 AM

Ambiguous

What you mean by create is ambiguous. This is the declaration of a type, and the definition of a struct type.

Sam 06-21-2014 05:08 AM

Structure in C

Structure - collection of variables of different types under a single name.
- A structure is created with the help of keyword struct.

Aparna 07-5-2013 04:08 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement