mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-27 04:44:08 +03:00
Moved enum into structs and renamed section to structs and enums
This commit is contained in:
parent
35aa1410e2
commit
09d8feda84
@ -215,7 +215,7 @@ namespace_int += 5; // Won't compile
|
|||||||
using NamespaceDemo;
|
using NamespaceDemo;
|
||||||
namespace_int += 5; // Valid
|
namespace_int += 5; // Valid
|
||||||
|
|
||||||
/* Structs */
|
/* Structs and Enums */
|
||||||
|
|
||||||
struct Closet {
|
struct Closet {
|
||||||
public uint shirts; // Default access modifier is private
|
public uint shirts; // Default access modifier is private
|
||||||
@ -229,6 +229,13 @@ var struct_init_3 = Closet() { // Type inference also works
|
|||||||
jackets = 3;
|
jackets = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum HouseSize { // An example of an enum
|
||||||
|
SMALL,
|
||||||
|
MODERATE,
|
||||||
|
BIG
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Classes and Object-Oriented Programming */
|
/* Classes and Object-Oriented Programming */
|
||||||
|
|
||||||
class Message : GLib.Object { // Class Message extends GLib's Object
|
class Message : GLib.Object { // Class Message extends GLib's Object
|
||||||
@ -271,12 +278,6 @@ public class Calculator : GLib.Object {
|
|||||||
var calc1 = new Calculator.with_name("Temp");
|
var calc1 = new Calculator.with_name("Temp");
|
||||||
var calc2 = new Calculator.model("TI-84");
|
var calc2 = new Calculator.model("TI-84");
|
||||||
|
|
||||||
enum HouseSize {
|
|
||||||
SMALL,
|
|
||||||
MODERATE,
|
|
||||||
BIG
|
|
||||||
}
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
* Read about building GUIs with GTK+ and Vala [here](http://archive.is/7C7bw).
|
* Read about building GUIs with GTK+ and Vala [here](http://archive.is/7C7bw).
|
||||||
|
Loading…
Reference in New Issue
Block a user