Numbers to Text Help
I'm trying to write a code that will translate numbers to texts. I've got the idea of how to do it, but I'm not sure why my code isn't working.
1 2 3 4 5 6 7 8 9 10
|
char *OnesTable[]= {"One","Two","Three","Four","Five","Six","Seven","Eight","Nine"};
int numHuns = int(net)/100;
if (numHuns > 0)
{
strcpy(netHunsString,OnesTable[numHuns-1]);
strcat(netHunsString," Hundred");
printf("%s"),netHunsString;}
|
What does netHunsString look like?
BTW, your ) is misplaced on line 9.
char *netHunString[100];
It's just a simple array and thanks. I fixed the mistake and now it's working all because of a misplaced parenthesis.
Topic archived. No new replies allowed.