1.

How To Define A Structure In Go?

Answer»

To DEFINE a structure, you must use type and struct statements. The struct statement defines a NEW data type, with more than one MEMBER for your program. type statement BINDS a name with the type which is struct in our CASE.

The format of the struct statement is this −

type struct_variable_type struct {
member definition;
member definition;
...
member definition;
}

To define a structure, you must use type and struct statements. The struct statement defines a new data type, with more than one member for your program. type statement binds a name with the type which is struct in our case.

The format of the struct statement is this −

type struct_variable_type struct {
member definition;
member definition;
...
member definition;
}



Discussion

No Comment Found