Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- ///////////////////////////////////////////////////////////
- void func(char* str) {
- for (int i = 0; str[i] != 0; i++) {
- if ((str[i] >= '0') & (str[i] <= '8')) {
- str[i] = str[i] + 1;
- }
- else if (str[i] == '9') {
- str[i] = '0';
- }
- }
- }
- int main() {
- char* temp_str = new char[7] { 'a' , '3' , '7' , '0' , '2' , 'd' , 0 };
- func(temp_str);
- cout << temp_str << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement