This is a sample where you can just read it in as a char string using correct functions. Also it filters out the numbers even if the string also contains some non-numeric characters.
Read about scanf:Code:#include <stdio.h> int main(){ char buffer[256]; fgets(buffer,255,stdin); int i; for(i=0;buffer[i]!='\0';i++){ switch(buffer[i]) { case '0': printf("zero "); break; case '1': printf("one "); break; case '2': printf("two "); break; case '3': printf("three "); break; case '4': printf("four "); break; case '5': printf("five "); break; case '6': printf("six "); break; case '7': printf("seven "); break; case '8': printf("eight "); break; case '9': printf("nine "); break; } } fgets(buffer,255,stdin); }
http://www.gidnetwork.com/b-59.html
http://www.gidnetwork.com/b-62.html
http://www.gidnetwork.com/b-63.html
http://www.gidnetwork.com/b-64.html