psionic,
I'm sorry, this completely slipped my mind.
Just before: printf alphabet[i]; you'll want to check for numbers > 26, because keep in mind the addition can end up being larger than 26 and no array values are above that.
This is simple, however, not truly functional. It won't work if you have a value larger than 52. So for this, you have to do some math.
I'm going to write it in psuedo code, becuase I really can't write it in C.
{
if ( i > 52 ) /*check for numbers larger than 52 (we'll use 58)*/
d = i / 26; /* d = 58 / 26 >> d = 2.2307...*/
(some function to remove the decimal)/* d = 2 */
e = 26 * d; /* e = 26 * 2 >> e = 52 */
i = i - e /* i = 58 - 52 >> i = 6 */
printf alphabet[i]; /* " f " */
else if (i > 26) /* perhaps the number is less than 52, yet larger than 26*/
i = 26 - i /* simple subtraction */
printf alphabet[i];
else /* less than or equal to 26 */
printf alphabet[i];
}
ok so i didn't write this next part in because i didn't want to confuse you any more than I already am.
You'll need to have the program enter into a for loop where it keeps decrementing the > 52 if statement. Meaning if " i " was originaly 100, the 1st go around would end with 78. You need to again compare 78 with 52. Since it is larger, re-apply the calculation to get it to a value lower than 27.
No wonder why I'm not a programmer.
J_