fork download
  1. #include <iostream>
  2. #include<string.h>
  3. using namespace std;
  4. void print(char *C)
  5. {
  6. int i=0;
  7. while( *C != '\0')
  8. {
  9. cout<<*C<<endl;
  10. C++;
  11. }
  12. cout<<"end";
  13. }
  14. int main() {
  15. char C[20]="hello";
  16. print(C);
  17. //char* C1;
  18. //C1= C;
  19. // int len;
  20. // len = strlen(C);
  21. //cout<<"char:"<<C1[3]<<endl;
  22. //C1[3]='r';
  23. //cout<<"value changes to"<<C1[3];
  24. return 0;
  25. }
Success #stdin #stdout 0s 4552KB
stdin
Standard input is empty
stdout
h
e
l
l
o
end