[Vala] private not valid or support in struct ?
- From: "Pigex.Zhang" <pigex zhang gmail com>
- To: vala-list gnome org
- Subject: [Vala] private not valid or support in struct ?
- Date: Thu, 30 Aug 2012 14:40:35 +0800
hi, all:
i'm reading the Vala
Tutoria(https://live.gnome.org/Vala/Tutorial#Structs) to learn vala
the tutiria mentioned in struct section:
A Vala struct may have methods in a limited way and also may have
private members, meaning the explicit public access modifier is required
i test it with following codes:
struct Color
{
private int red;
}
static int main()
{
var c = Color();
c.red = 1; //here it can access the member directly
stdout.printf("c.red = %d", c.red);
return 0;
}
it is compiled successed.....its beyond my expectations! Sorry for my
bad english.....
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]