Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 4847
3 votes

Pset2 - Receiving different outputs each time I run my code- Vigenere.c

When encrypt[n] is declared, it doesn't allow for the end of string marker at the end. Also, the end of string marker is never added to the string, so when it is printed at the end of the program, gar …
Cliff B's user avatar
  • 69.3k
0 votes
Accepted

pset 2, vigenere, created cipher function, but had to subtract 19?

The problem lies in your formula for encoding. (c -'a' + k - 19) % 26 + 'a'; You recognized that you need to subtract the base value, 'a' from the letter to be encoded, but you forgot to d …
Cliff B's user avatar
  • 69.3k