Home » C Programming » Pointers

Which statement will you add to the following program to ensure that the program outputs "CuriousTab" on execution? #include int main() { char s[] = "CuriousTab"; char t[25]; char *ps, *pt; ps = s; pt = t; while(*ps) *pt++ = *ps++; /* Add a statement here */ printf("%s\n", t); return 0; }

Correct Answer: *pt='\0';

← Previous Question Next Question→

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion