Re: [Vala] shouldn't be sizeof expression is a constant?
- From: Leonhard Küper <leonhard kueper tu-dortmund de>
- To: vala-list gnome org
- Subject: Re: [Vala] shouldn't be sizeof expression is a constant?
- Date: Tue, 29 Mar 2011 05:36:11 +0200
Hallo
const int c = sizeof(int);
this code is not compiled. Why? It's allowed in C
I've got a similar Problem. I've tryed to complie:
private const double MAX_RGB = (double)uint16.MAX;
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);
I'm sorry, but I don't understand. :( Should I generaly do not use
constants? How do I use them?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]