#include "stdafx.h"
#include <iostream>
#include <stdlib.h>
using namespace std;
#define null 0

class rstring {
public:
	void* reversestring(char *p, char *y) {
		char  *rp, *rxp, *yxp, *oldptr;
		int x = strlen(p);
		//rxp = (char  *)calloc(strlen(p) +1, sizeof( char ));
		yxp = y;
		oldptr = p;
		rp = &p[(strlen(p) - 1)];

		while (*p != null)
		{
			*yxp = *rp;
			yxp++;
			rp--;
			p++;


		}
		return NULL;
	}
	
};
	


int main()
{
	rstring *test = new rstring;
	char *rxp = (char  *)calloc(strlen("this is it") + 1, sizeof(char));
	test->reversestring("this is it", rxp);


	cout << rxp << endl;
	free(rxp);
	delete test;
    return 0;
}