Welcome fellow students, register yourself and dive into asking questions, giving answers and helping the community learn with you.

Negh z`f av huf pcfx bt gz`rwep oz` is printed instead of Negh zf av huf pcfx bt gzrwep oz

0 votes
asked Dec 16, 2015 in Pset2 by Alisher (260 points)
edited Dec 16, 2015 by Alisher
After each z letter ` is added. After each Z, @  is added in Vigenere. So, if i run the program

./vigenere z


z`z`Z@Z@z'z' is printed. I don't know why. If anybody can help me understand such weird cyphering.

check50 btw shows that everything is good.

Also, i found out that ` symbol is right before 'a', and @ is right before 'A'

2 Answers

0 votes
answered Dec 16, 2015 by Alisher (260 points)
Thanks gdb. I resolved. >='z' and <='z' conditions in different if statements made 'z' print 'z' and 'z' - 26 one after another.
0 votes
answered Dec 19, 2015 by Faïza Harbi (11,960 points)
check for ctype.h library, and also be careful as for how you handle the key: you don't move the key unless it's an alphabetical character
Welcome to CS50xHelpers Q&A, where you can ask questions and receive answers from other members of the community.

190 questions

248 answers


3,602 users

6 Online
0 Member And 6 Guest