#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
char your_string[256];
char new_string[256];
void ReverseString();
int main()
{
cin.getline(your_string, 256);
ReverseString();
cout << new_string << "\n";
return 0;
}
void ReverseString()
{
int x = strlen(your_string)-1;
for(int y = x; y >= 0; y--)
{
new_string[x-y] = your_string[y];
}
}
I need the program to ask the user two times a string. Then the function should join the string and return the joined string to main.
Thank you very much!