Variable size/Get: Difference between revisions

(→‎{{header|Lua}}: added Lua solution)
Line 1,334:
 
=={{header|Vala}}==
<lang vala>void main(){
/* you can replace the int below with any of the vala supported datatypes
void main(){
see the vala documentation for valid datatypes.
ulong x = sizeof(int); // returns # of bytes used to store an int
*/
// is returned as a ulong, but could be typecasted to int with: int x = (int) sizeof(int)
stdout.printfprint(@"%lu$(sizeof(int))\n", x);
}</lang>
}
</lang>
 
=={{header|XPL0}}==
Anonymous user