this is my code i made this code because to reverse the words and get the number or frequent characters.this my code below.
so the question ask me to input character, reverse the characters and get the number or frequent numbers. i am really grateful for you if you can help me, i need you to correct that post and send me back the code actually the due date is next friday.
Code:
#include <iostream> #include <cstring> using namespace std; void reverse(char *str, int count = 0); int main() { char *s1 = "This is a taste for you"; char *s2 = "i like her smile her delicate talk i like her."; reverse(s1); // reverse entire string reverse(s2, 50); // reverse 1st 7 chars cout << s1 << '\n'; cout << s2 << '\n'; return 0; } void reverse(char *str, int count) { int i, j; char temp; if(count == 0) count = strlen(str)-1; for(i = 0, j=count; i < j; i++, j--) { temp = str[ i ]; str[ i ] = str[j]; str[j] = temp; } }
Comment