// Program to convert int to a string without built in functions.
// Date 18:13 11/10/2016
// By Ben a.k.a DreamVB

#include <iostream>

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

string InToStr(int num){
	char str[80] = { '\0' };
	char tmp[80] = { '\0' };
	int t = num;
	int rem = 0;
	int len = 0;

	if (num == 0){
		return "0";
	}

	//Reverse number and build the string from each digit
	while (t > 0){
		rem = t % 10;
		t /= 10;
		str[len] = rem + '0';
		len++;
	}

	t = 0;
	//Reverse string
	while (len !=0 ){
		len--;
		tmp[t] = str[len];
		t++;
	}
	return tmp;
}

int main(int argc, char *argv[]){
	int num = 1824;
	//Convert num to a string and output value.
	cout << "Int converted to string : " << InToStr(num).c_str() << endl;

	system("pause");
	return 0;
}