Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- void reverse(char *str, int count)
- {
- for( int x = 1; x <= count; x++)
- {
- cout << str[ count - x];//вывод пеевернутой строки
- }
- }
- int main() {
- // string S = "Test of pen";
- char str[100] = "Test of pen";//строка которую мы будем переворачивать
- // str = strcpy(str, S);
- reverse(str, 6);// отправляем унк строку и до какого символа мы будем перевораивать строку
- // cout << str << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement