fork download
  1. #include <stdio.h>
  2.  
  3. const char *getString()
  4. {
  5. const char *str = "Stack Overflow";
  6. return str;
  7. }
  8. int main()
  9. {
  10. const char *s = getString();
  11. printf("%c\n", s[1]);
  12. printf("%s", s); // Statement -1
  13. printf("%s\n", s); // Statement -2
  14. return 0;
  15. }
Success #stdin #stdout 0s 2052KB
stdin
Standard input is empty
stdout
t
Stack OverflowStack Overflow