fork download
  1. #include <stdio.h>
  2.  
  3. char hname[100] = "";
  4.  
  5. int geth(char *name, size_t namelen) {
  6. strncpy(name, "local_name", namelen);
  7. return 0;
  8. }
  9.  
  10. int main(void) {
  11. // your code goes here
  12. if(strlen(hname) == 0)
  13. geth(hname, 100);
  14. printf("%s", hname);
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 10320KB
stdin
Standard input is empty
stdout
local_name