X-Git-Url: https://piware.de/gitweb/?p=learn-rust.git;a=blobdiff_plain;f=call-c-from-rust%2Fc-langinfo.c;fp=call-c-from-rust%2Fc-langinfo.c;h=dacb763683d66dd8af30493b7c7ef692ed0d510c;hp=0000000000000000000000000000000000000000;hb=225c6b2420e01dca1f3a570d3ed664b825cf883c;hpb=b30a5742f3c1d963002de6e98327393b5ae00603 diff --git a/call-c-from-rust/c-langinfo.c b/call-c-from-rust/c-langinfo.c new file mode 100644 index 0000000..dacb763 --- /dev/null +++ b/call-c-from-rust/c-langinfo.c @@ -0,0 +1,12 @@ +#include +#include +#include + +int main() +{ + printf("locale: %s\n", setlocale (LC_ALL, "")); + printf("codeset: %s\n", nl_langinfo(CODESET)); + printf("date/time format: %s\n", nl_langinfo(D_T_FMT)); + printf("currency: %s\n", nl_langinfo(CRNCYSTR)); + return 0; +}