Can someone please help me with this code, it should change numbersd to text. It compiles but the CMD box has the incorrect output.
#include "stdafx.h"
#include <stdio.h>
#include <string>
//#include <math.h> // for exp(), pow() and log10()
int _tmain(int argc, _TCHAR* argv[])
{
int number=5;
char text[10][10] = {"zero","one","two","three","four","five","six","seven","eight","nine"};
int repeat;
char *output;
//Get the number
//int temp1 = scanf("%d", &number);
//How many iterations
//float temp2 = log10(float(number));
repeat = 1;
//Generate output
for (int i=1; i<repeat; i++) {
int temp3 = number % 10;
output = text[temp3];// . " " . output;
number /= 10;
}
//Print output
printf ("%s\n", output);
return 0;
}