In this program user ask to delete character from String using pointer concept. User declares char type array variable. User using malloc() function for the allocate the memory to the variable. Then user asks to enter the string then shifted the ptr to str variable for address reference. Then user puts the while condition to verify condition. In condition while (*ptr! =NULL) then if (*ptr!=ch) is that all the conditions got true the *ptr2 will be *ptr2++ with increment operator. And in the end the given result will be on the screen at the end.
This is C program where coder has to use pointer function for the deletion of character from string.
- Declare the variables.
- Using loop statement and control statements.
- Display result in the screen.
Here is C source code for Deleting the Character from the string using pointer function. The output of this program shown below.
printf("Enter a String :");
printf("Enter the Character you Want to Delete :");
ptr = str;