Re: [Vala] shouldn't be sizeof expression is a constant?



On 03/27/2011 03:26 PM, Maga Abdurakhmanov wrote:
Hi!

const int c = sizeof(int);

this code is not compiled. Why? It's allowed in C




_______________________________________________
vala-list mailing list
vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list
My vala is expecting a ulong.
Also sizeof apparently isn't considered a constant in Vala. Which means you cannot use const. This works for me:

ulong c = sizeof(int);

--
Jonathan Ryan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]