// Int To String2
// Date 14:50 24/10/2016
// By Ben a.k.a DreamVB

#include <iostream>

using namespace std;
using std::cout;
using std::endl;

void IntToString(int value, char *src){
	char snum[16];
	int pos = 0;
	int t = 0;

	//Get value
	t = value;

	do{
		//Add each number digit to the snum array
		snum[pos] = '0' + (t % 10);
		//Divide by ten
		t /= 10;
		//INC counter
		pos++;
	} while (t != 0);

	//Turn the string backwards
	while (pos != 0){
		pos--;
		//Set src with the string digit from snum
		*src++ = snum[pos];
	}
	//Add ending char
	*src++ = '\0';
}

int main(int argc, char *argv[]){
	int num = 65;
	char snum[16];
	cout << "Enter a number to convert to a string : ";
	cin >> num;
	//Convert int to string
	IntToString(num, snum);
	//Print out the number.
	cout << "Here is the number displayed as a string : " << snum << endl;

	system("pause");
	return 0;
}