Simple doubt related to strings in C (question in an interview)
- by piemesons
// The first example:
char text[] = "henri";
char *p;
p = text;
*(p + 1) = 'E'; // Output = hEnri
// Now If we want to remove the "e" ie hnri, we would go for?????
*(p + 1)=?????
Please dont say start copying the array. I am looking for the best solution.
Its an interview question...
EDIT
I specially mentioned the question that i am not asking for the solution like start moving the element. I thought there must be some other good solution..