Questions tagged [substitution]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
30 views

cs50 pset2 substitution Segmentation error

I am stuck at working out what is wrong with my code. I receive the values entered at the command line, I ask the user for text, I validate the command line values as characters of the alphabet and ...
0
votes
1answer
16 views

Pset2 Substitution My code working when I use debugger and does not working thorough console or test. What am I doing wrong?

Sorry for my English( I am learning. 1.I have make this code, but when I have wrote "isduplicate" function it makes uncatchable bug. Code work as my expectetion only in debugger. So where is ...
0
votes
1answer
20 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); ...
0
votes
1answer
19 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(...
0
votes
1answer
13 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 ...
0
votes
2answers
30 views

PSet2 / Substitution

I am trying to make an upper case key and a lower case key of the one typed by the user but when I use the toupper and tolower functions they turn all my chars into lower or upper. Not just the one I ...
0
votes
1answer
49 views

incompatible pointer types passing 'string' (aka 'char *') to parameter of type 'string *' (aka 'char **')

Im writing a funtion that takes string as a argument and gives back a integer. This function counts lenght of a string entered at the command line argument. I get an error :" incompatible pointer ...
0
votes
1answer
33 views

Check50 Substitution error

I am able to execute the code with any errors. The solution(output) to the examples given in the problem set 2 match my solution and yet check50 shows there are a number of issues in the output. ...
0
votes
0answers
108 views

CS50 - PSET2 - Substitution Segmentation fault

I keep getting 'Segmentation fault' every time I run the code(mentioned below). The code is compiling just fine. It's asking for input and is returning required message when the command line argument ...
0
votes
0answers
51 views

CS50x pset2 substitution, check50 test returns negative even though output is correct

My code fails only one of the test in check50 even though the output is correct and passes other ones. The test it fails: :( encrypts all alphabetic characters using DWUSXNPQKEGCZFJBTLYROHIAVM as key ...
0
votes
0answers
49 views

Encrypt plaintext in substution.c

Here is my encryption of plaintext after validation the key. //Encrypt Code string plaintext = get_string("plaintext: "); // int array[26] = {0}; string encText = plaintext; //converts user ...
0
votes
1answer
64 views

pset2 substitution not working

im kinda stuck with pset2, substitution. Any help is appreciated. When trying to convert the plaintext into the ciphertext, the formula just doesnt do anything. I suppose there is something wrong ...
0
votes
1answer
119 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: #...
0
votes
2answers
104 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 ...
0
votes
1answer
93 views

Pset2 - Substitution - “Output not valid ASCII text” error despite correct cipher output

after running check50 I am getting an "output not valid ASCII text" error for the following problems: :( encrypts "A" as "Z" using ZYXWVUTSRQPONMLKJIHGFEDCBA as key output not valid ASCII text :...
0
votes
1answer
91 views

[Week 2 Substitution.Why does my code fail the checks even if the output is correct?

Here is my code. Apologies if it is hard to understand / messy. When I check50 it shows this. I have a brief idea on how to solve the invalid characters in key but I don't mind some help on that too. ...
0
votes
2answers
84 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 ...
0
votes
2answers
256 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: ...
0
votes
1answer
56 views

hi, i tried to solve problem set 2 substitution. it gives right output but check50 is giving errors

include include include include include int main(int argc, string argv[]) { if (argc != 2) { printf("Usage: ./caesar key\n"); return 1; } int k = strlen(argv[1]); ...
1
vote
1answer
238 views

pset 2-substitution-error handles multiple duplicate characters in key timed out while waiting for program to exit

Im working on substitution from pest 2 and I'm getting everything approved except for the last message: handles multiple duplicate characters in key timed out while waiting for program to exit Below ...
0
votes
1answer
118 views

During PSET 2: Substitution, I got an expected expression error for get_string. Please help

substitution.c:24:23: error: expected expression char* plaintext = get_string(); ^ /usr/include/cs50.h:109:53: note: expanded from macro 'get_string' #define get_string(...) ...
1
vote
1answer
499 views

Pset 2 - Substitution - Error - handles multiple duplicate characters in key

I have finished the substitution pset2 problem, however, there was one error when I submitted my assignment. The description of this error was handles multiple duplicate characters in key. timed out ...
1
vote
1answer
315 views

PSET2 Substitution - Output seemingly correct, fails check50 (null character?)

thank you for your help in advance! I can't wrap my head around what's wrong with my code as the output is (seemingly) correct. I suspect it has something to do with the null character. #include <...
0
votes
1answer
2k views

Get help in Pset2 Substitution

The Errors- :) substitution.c exists :) substitution.c compiles :( encrypts "A" as "Z" using ZYXWVUTSRQPONMLKJIHGFEDCBA as key output not valid ASCII text :...