Question: Given a C String, write a function removeNonAlpha that removes all non-alphabet chars in the C String. When removing a non-alphabet char, you should shift
Given a C String, write a function removeNonAlpha that removes all non-alphabet chars in the C String. When removing a non-alphabet char, you should shift all following chars one position to the left. Dont forget to shift the null byte as well!
char cstr[] = "S5mal.lb-erg! Is+ C$s Senpai$$$"; removeNonAlpha(cstr); for (int i = 0; cstr[i] != '\0'; i++) cout << cstr[i];
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
