to_big_endian


Description:

[ CCode ( cname = "GINT_TO_BE" ) ]
public int to_big_endian ()

Example: Int to big endian:

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

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