Decoding

This is a discussion on Decoding within the C Programming forums, part of the General Programming Boards category; Hi Guys, Working on an encoding and decoding example and have the encoding working fine. Its the decoding that is ...

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    3

    Decoding

    Hi Guys,

    Working on an encoding and decoding example and have the encoding working fine. Its the decoding that is proving to be a challenge...

    Essentially, I am encoding characters like:

    ttttrrrrruuuuhhhyyiii

    to give output like

    4t5r4u3h2y3i

    and thats fine, its just when i want to decode something like:

    2t3y2r to ttyyyrr

    is where i have diffculties

    I have tried a few different ways but I'm stumped and would greatly appreciated a few pointers.

    I think its the printf where im going wrong, I cant seem to grasp how to tell the program to print t twice (above example) when 2 is in front of it

  2. #2
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Katy, Texas
    Posts
    2,309
    methinks you forgot to post your code.
    Mac and Windows cross platform programmer. Ruby lover.

    Quote of the Day
    12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong.

    Amen brother!

  3. #3
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    Your problem is on line 26, just before the return.














    That'd be POST YOUR CODE!!!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with decoding program...
    By porsche911nfs in forum C++ Programming
    Replies: 18
    Last Post: 04-10-2009, 12:21 AM
  2. Help decoding base_64+GZipped string
    By Zeokat in forum C# Programming
    Replies: 3
    Last Post: 12-05-2008, 04:06 PM
  3. Decoding applications?
    By Hybird in forum C++ Programming
    Replies: 2
    Last Post: 11-13-2005, 06:19 AM
  4. Decoding
    By jk81 in forum C Programming
    Replies: 4
    Last Post: 11-12-2002, 10:24 PM
  5. Decoding & Encoding the sound?!?
    By waldis in forum C++ Programming
    Replies: 2
    Last Post: 10-20-2002, 06:41 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21