Example: Int to little endian

public static int main (string[] args) {
if (12345.to_little_endian () == 12345) {
print ("Little endian machine\n");
} else {
print ("Big endian machine\n");
}
return 0;
}

 valac --pkg glib-2.0 int.to_little_endian.vala

See:




2022 vala-language.org