fork(1) download
  1. #include <locale.h> // setlocale
  2. #include <string.h> // strlen, strcpy
  3. #include <stdio.h> // printf
  4.  
  5. int main()
  6. {
  7. char* pLocale;
  8. pLocale = setlocale(LC_ALL, NULL);
  9. char buffer[strlen(pLocale)+1]; // + 1 char for string terminator, see https://stackoverflow.com/a/14905963/711006
  10. strcpy(buffer, pLocale);
  11. printf("%s\n", buffer);
  12. return 0;
  13. }
Success #stdin #stdout 0s 4468KB
stdin
Standard input is empty
stdout
C