void str_words_in_rev(char *input, int len) {
	int i = 0, prev = 0;
	if (input == NULL) {
		return;
	}
	while (i < len) {
		if (input[i] == ' ') {
			strev(input, prev, i - 1);
			prev = i + 1;
		}
		i++;
	}
	strev(input, prev, len - 1);
	strev(input, 0, len - 1);
	return;
}
Beispiel #2
0
void main()
{
char str*;
cout<<"enter the string to be reversed";
cin>>str;

str=strev(str);
cout<<str;
}