fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void f(char* s,int n) { s[-n] = '!' ; }
  5.  
  6. const int N=10;
  7. static char s[N];
  8. static char a[N];
  9.  
  10. int main ()
  11. {
  12. int i;
  13. for (i=0; i<N; i++)
  14. a[i]='0'+i;
  15.  
  16. for (i=0; i<N; i++)
  17. cout<<a[i];
  18. cout<<'\n';
  19.  
  20. f(s,N);
  21.  
  22. for (i=0; i<N; i++)
  23. cout<<a[i];
  24.  
  25. cout<<'\n';
  26. }
Success #stdin #stdout 0.01s 2680KB
stdin
Standard input is empty
stdout
0123456789
!123456789