Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cctype>
- #include <cstring>
- #include <cmath>
- using namespace std;
- void deleteG(char *(msg))
- {
- int pos = 0;
- while (isalpha(*(msg + pos)) || isspace(*(msg + pos)))
- {
- if (*(msg) == 'g' || *(msg) == 'G')
- {
- *(msg + pos) = *(msg + pos + 1);
- }
- pos++;
- }
- }
- int main()
- {
- char msg[100] = "I recall the glass gate next to Gus in Lagos, near the gold bridge.";
- deleteG(msg);
- cout << msg; // prints I recall the lass ate next to us in Laos, near the old bride.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement