Example: Read from stdin

public int main (string[] args) {
string str = null;
do {
str = stdin.read_line ();
print ("Out: \"%s\"\n", str);
} while (str._strip () != "exit");

return 0;
}

 valac --pkg glib-2.0 stdin.vala

See:




2022 vala-language.org