Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
2 answers
29 views

PSet2, Substitution, Unexpected Output - Nested FOR loops producing repeat iterations

I've tried to figure out how an iteration could repeat itself. Iterations 1 and 4 seem to repeat. I've left in my debugging printf lines so you can see how these iterations in my nested FOR loops are ...
fawkeskc's user avatar
0 votes
0 answers
47 views

PSET2 SUBSTITUTION works fine ONLY if plaintext is UNDER 9 CHAR

I was approaching the end of the substitution problem of PSET2 when I hit a snag I could not solve. I have already written the code to check the key for the various conditions they provide. My problem ...
Alvaro Barboza's user avatar
1 vote
1 answer
170 views

pset2, problem SUBSTITUTION, Is there more than 1 way to check for repeated characters in the 26-character key?

I have a question concerning pset2, SUBSTITUTION. I finalized the 3 initial filters of this problem: character count argument count non-alphabetical characters. now I'm moving to the fourth ...
Alvaro Barboza's user avatar
0 votes
1 answer
89 views

Substitution Just can't handle invalid keys

My code - #include <stdio.h> #include <cs50.h> #include <stdlib.h> #include <ctype.h> #include <string.h> bool check_distinct_char(string s); bool check_char(string s); ...
FoundABetterName's user avatar
0 votes
1 answer
33 views

pset2 substitution unable to identify string which has character repetition

Here is my code- #include <stdio.h> #include <cs50.h> #include <stdlib.h> #include <ctype.h> #include <string.h> bool check_distinct_char(string s); bool check_char(...
FoundABetterName's user avatar
0 votes
2 answers
40 views

pset2 substitution checking if all the characters in the key are different

I have almost finished substitution. Just that I have not yet been able to come up with a elegant way to check if all the characters in the key are distinct hence I used the following way to check if ...
FoundABetterName's user avatar
0 votes
1 answer
307 views

Segmentation fault in Substitution - Problem Set 2

I have finally finished writing my code for the Substitution question in Problem Set 2, but Check50 tells me that my code has a segmentation fault when there is a lack of key. My code is as follows: #...
Ethan Mark's user avatar
0 votes
3 answers
659 views

How to reject repeated letters for Substitution in Problem Set 2

I am trying to write some code for the Substitution question in Problem Set 2, but I cannot figure out how to reject the case where a user gives a key with repeated letters. My code thus far is as ...
Ethan Mark's user avatar
0 votes
2 answers
204 views

pset2 substitution - isalpha doesn't seem to recognize letters

I'm relatively inexperienced at programming, but I thought I understood how to use command-line prompts well enough to try the substitution problem. I'm having an issue with isalpha that I don't ...
dubflicker's user avatar
0 votes
2 answers
402 views

PS2 substitution

I am trying to check that the substitution key contains all the alphabets but am getting error: expression result unused for this line of code: s, l ++; Can anyone help, this is my code as of now: ...
Olivia's user avatar
  • 23