decoding/encoding

This is a discussion on decoding/encoding within the C++ Programming forums, part of the General Programming Boards category; Ok, i have to create a program that will decode a message. I have the key and everything but have ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    30

    decoding/encoding

    Ok, i have to create a program that will decode a message. I have the key and everything but have now idea on where to begin on setting the program up. I know there has to be a part of the program which contains the key, a part with the encoded message then somehow i have to make it so that the encoded message will look at the key and decode the message. Any ideas on how to get started will be greatly appreciated.

  2. #2
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    Steps to decoding:

    1) Set up an array (if multiple characters will be used in one intake, make it multidimensional). Inside the array, put all the sequences that will be understood by your decoder, each sequence taking up an element.

    2) Set up another array, and initialize it to null.

    3) Once you have read in your data how ever you want to do that, make a loop that will be repeated with every sequence of charcaters you want to interpret. In that loop, have if statements like the following:

    if (sequence_being_tested == a_possible_sequence)
    {
    array_intialized_to_null[element_number] = sequence_being_tested;
    }

    At the end of the loop, increment element_number.

  3. #3
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    ah yes, a programmers foray into the world of cryptology...

    this is a bit of an arbitrary post.... seek further help? show us your source!!!
    hasafraggin shizigishin oppashigger...

  4. #4
    Registered User
    Join Date
    Oct 2001
    Posts
    30
    Hello again, I have been working on this now for a while and I am completly confused. so far I have the array set up and the encoded message in the program. I tried writing if/else statements to translate all the letters but that didnt work. The reason i think that it didnt work is because I dont know where to put the encoded message so that the if/else statements can read it. Attached is what I have so far for the program. If I could get any help it would be greatly appreciated.
    Attached Files Attached Files

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. rot13 decoding/encoding help!!!!!
    By zaff1 in forum C++ Programming
    Replies: 0
    Last Post: 02-06-2003, 03:59 PM

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