Thread: Can anyone see any errors in this cipher code?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Oct 2012
    Location
    Forest Hill, Maryland, United States
    Posts
    39
    So if I look at this correctly, my issue is in the decrypt function with: flag= flag%26;
    Do you agree?


  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by dodgetech View Post
    So if I look at this correctly, my issue is in the decrypt function with: flag= flag%26;
    Do you agree?

    No problem, dodgetech - and yes, if you are assigning a letter or a number, based on a negative index of the character set (aka ascii values) - that would be a big red flag, since there are none.

    However, I'd still like to know that the encrypt function was working OK, at least in a simple preliminary test, with vowels and consonants.

    When you're working with arrays, you always need to test or watch carefully, the ENDS of them (high and low), to see that they don't run over or under, their legit range. Vowels to test would be a and e, and u and y (if you have y as a vowel - some do, some don't). Consonants to test would be b and c and x and z.

    We know you're a beginner - but we're not going to let you get away with anything anyway! <smile>

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need some help with errors in the code
    By lukis123 in forum C Programming
    Replies: 5
    Last Post: 11-03-2011, 11:00 PM
  2. Help with errors on my code!
    By ashleyd in forum C++ Programming
    Replies: 7
    Last Post: 10-30-2011, 01:35 PM
  3. Errors in code
    By itzme in forum C++ Programming
    Replies: 12
    Last Post: 01-07-2005, 05:11 PM
  4. Errors (not in code)
    By Da-Spit in forum C++ Programming
    Replies: 8
    Last Post: 05-18-2002, 12:31 AM