Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Char array
- void qbertcuss(char *s, int len)
- {
- for ( in q = 0; q < len; ++q )
- {
- if ( !s[q] ) return; // exit on null char if it is sooner than 'len'
- switch( s[q] )
- {
- case 'a':
- case 'e':
- case 'i':
- case 'o':
- case 'u':
- case 'A':
- case 'E':
- case 'I':
- case 'O':
- case 'U':
- s[q] = '*'; break;
- default: break;
- }
- }
- }
- // std::string
- void qbertcuss(std::string *s)
- {
- for ( int q = 0; q <= s->size(); ++q )
- {
- switch( s[q] )
- {
- case 'a':
- case 'e':
- case 'i':
- case 'o':
- case 'u':
- case 'A':
- case 'E':
- case 'I':
- case 'O':
- case 'U':
- s[q] = '*'; break;
- default: break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement