[Vala] How to define a const string array in Vala?
- From: PCMan <pcman tw gmail com>
- To: vala-list <vala-list gnome org>
- Subject: [Vala] How to define a const string array in Vala?
- Date: Wed, 21 Dec 2011 16:34:28 +0800
I C language, I can do this:
const char* strs[] = {
"string1",
"string2",
"string3",
NULL
};
In Vala, I cannot find a way to do the same.
Defining a string[] will cause copy of every constant string.
If I use unowned, like this:
unowned string strs[] = {
...
};
This did not generate the same result.
Every element of the string array gets copied.
So, If I need an array containing constant unowned strings, how to define
it in Vala?
Besides, in C language, we can write "const char* const *".
In Vala, I cannot find equivalent stuff.
Help is needed.
Thanks a lot!
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]