Hello guys, I want to alter a string inside a function, but it is not working.
Here is the function:
Code:#include <stdio.h> void test (char *ch){ ch[0] = 0; ch[1] = 1; ch[2] = '\0'; } int main(){ int i; char ch[20]; test(ch); for(i=0;i<20 && ch[i] != '\0';i++){ printf("%c", ch[i]); } return 0; }