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