1.

What are structs in C programming? Write down their syntax and an example of the same.

Answer»

A structure or struct in C programming is a user-defined data type that lets us mix data ITEMS of a lot of TYPES. A structure is basically used to represent a record.

The syntax of structs in C programming is given below:

struct nameOfStruct { data member DEFINITION; data member definition; ... data member definition; };

An example of structs in C programming is given below:

struct Node{ int val; Node *next;};


Discussion

No Comment Found