[Vala] Unboxing Value Types
- From: Sam Wilson <tecywiz121 hotmail com>
- To: <vala-list gnome org>
- Subject: [Vala] Unboxing Value Types
- Date: Tue, 19 Jan 2010 11:02:29 -0500
Hello again!
random question, how are you supposed to unbox a value type (say float) ?
Here is how I am trying to do it, but it won't compile:
[code]
public void main(string[] args)
{
float? a = 6;
printfloat((float)a);
}
public void printfloat(float t)
{
stdout.printf("%f\n", t);
}
[/code]
The output from valac and cc
unbox.vala: In function ‘_main’:
unbox.vala:4: error: pointer value used where a floating point value was expected
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)
----
compiled with Vala 0.7.9: `valac -g --enable-experimental --enable-checking -o junk *.vala`
Thanks,
Sam
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]