Questions tagged [substitution]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
20 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
7 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
53 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
30 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
44 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
42 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
72 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
45 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
55 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
56 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
65 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
194 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
47 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]); ...
0
votes
1answer
159 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
88 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(...) ...
0
votes
1answer
348 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
248 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
1k views

Get help in Pset2 Substitution

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