C language Program extract help

Discussion in 'Programming' started by reinvaldez, Feb 3, 2009.

  1. #1
    startPos = strlen(MyInput);
    			do {
    		startPos = startPos - 3;
    				if (startPos < 0) {
    				numdigits = numdigits + startPos;
    				startPos = 0;
    					}
    				strncpy(threedigits, MyInput + startPos, numdigits);
    				threedigits[numdigits] = '\0';
    			printf("%s ",threedigits);
    Code (markup):
    Hello DP, really need your help.
    This code snippet extract the Input number by 3digits. So for example I input 123456789, it will look like this 789 567 123 >> How could I get the 1st entry in order for it to perform the processing of converting those number to words and so on so forth. I'm a newbie in C language.
     
    reinvaldez, Feb 3, 2009 IP
  2. MunnaMobile

    MunnaMobile Banned

    Messages:
    234
    Likes Received:
    58
    Best Answers:
    0
    Trophy Points:
    0
    #2
    dont you think out put you think should be 789 456 123 ??
     
    MunnaMobile, Feb 3, 2009 IP
  3. reinvaldez

    reinvaldez Member

    Messages:
    170
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #3
    Oh I am very sorry. Yeah you are right, if I input 123456789 the outcome of the code snippet will be 789 456 123. How could process this output in order to give them values in words? Really need your help. Thanks.
     
    reinvaldez, Feb 4, 2009 IP
  4. MunnaMobile

    MunnaMobile Banned

    Messages:
    234
    Likes Received:
    58
    Best Answers:
    0
    Trophy Points:
    0
    #4
    will send you a function for the same !!
     
    MunnaMobile, Feb 4, 2009 IP
  5. reinvaldez

    reinvaldez Member

    Messages:
    170
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #5
    yes thank you. I wait for your reply. :)
     
    reinvaldez, Feb 4, 2009 IP