Compound data type: Difference between revisions
m
→{{header|Vlang}}
No edit summary |
|||
Line 2,679:
=={{header|Vlang}}==
Vlang also supports embedding structs into other structs and assigning methods to structs.
<lang vlang>struct Point {
x int
Line 2,685 ⟶ 2,686:
// main() declaration can be skipped in one file programs
// we can define whether immutable or mutable by using the "mut" keyword
mut p := Point{
|