Skip to main content

Questions tagged [caesar]

Caesar Cipher, one of the assignments in Problem Set 2.

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

Having problems with Pset2, argv[1]: program doesn't 'see' it

I'm having a problem with argv[]: the code doesn't seem to 'see' it!! With a key that's either too long or too short, the program behaves as expected (prints out error message, exits). But if I input ...
mimi's user avatar
  • 5
0 votes
2 answers
247 views

Caesar doesnt pass "non-numeric key" check

I've read all the other answers I can find about people having a similar problem, but mine doesn't seem to be the same issue. Everyone says to use isdigit first, then use atoi, which is what I've ...
Brandon Zemel's user avatar
0 votes
1 answer
58 views

My code for Caesar gets segmentation error when executed, but in debugger it works fine

I'm getting a segmentation error as soon as I execute this program. I've run it through the debugger and it works fine and outputs the correct ciphertext. There's gotta be something going on in the ...
Brandon Zemel's user avatar
1 vote
1 answer
195 views

Check50 for caesar, pset2 returns an error "Not valid ASCII text" twice, even though it encrypts correctly for the same text used in check50

Okay, the code is given below (forgive me if there are too many comments!!). Please help!! Code: //the objective of the program is to create a simple encryption of the text inputted by the user with ...
AwesomeRAG7's user avatar
0 votes
2 answers
355 views

pset2 - Caesar. Code works but fails check50. Expected and actual output match

Sorry, I know this has been asked before but I have read all the answers and nothing works! Please help. ERRORS :) caesar.c exists. :) caesar.c compiles. :) encrypts "a" as "b" using 1 as key :( ...
Beth Burroughs's user avatar
0 votes
1 answer
307 views

I have a segmentation fault in Caesar in pset 2

Okay, first time writing here and I am a complete noobie. The program compiles and I have run the debugger, and it seems that I have a segmentation fault which I have marked. Also, I have used a lot ...
AwesomeRAG7's user avatar
0 votes
2 answers
59 views

pset2 caesar - showing "output not valid ASCII text once"

#include <stdio.h> #include <cs50.h> #include <ctype.h> #include <string.h> #include <stdlib.h> int cypher(string k, char p); int main(int argc, string argv[]) { if ...
Vsjain's user avatar
  • 1,016
0 votes
1 answer
24 views

Command-line validation key

I cannot figure out why am I getting these results? I'm currently only trying to validate the Numeric Key when typing 20x as a command-line argument get Usage: ./caesar Key #include <cs50.h> #...
Laureano Jos Gutirrez Vallenil's user avatar
0 votes
1 answer
166 views

Pset 2 - Caesar - Code accepts numbers with letters

My code accepts numbers with letters, e.g. 2x. When running check 50 I get this error 'handles non-numeric key, timed out while waiting for program to exit. Log running ./caesar 2x..' The code is not ...
MarkB's user avatar
  • 7
0 votes
1 answer
633 views

I have the error of :( handles non numeric key - timed out while waiting for program to exit in Problem Set 2 Caesar

I have the error occured. May I know wheres the issue & where to add or remove the code? I'm new to the this. Thank You in advanced. #include <stdio.h> #include <stdlib.h> #include &...
Mahindra Vijay's user avatar
0 votes
1 answer
189 views

Cs50, cipher text not printing

When i run my code, everything seems to be fine apart from the printing of the ciphertext, and the code doesnt seem to be getting passed the for loop of the string length of plain. Any ideas? #...
anonymous's user avatar
0 votes
1 answer
77 views

Caesar: Validating the key - stuck

I am stuck with Caesar, validating the key. Before i use the atoi function, I want to check if argv consists of digits. I watched the linear search movie but is is to cryptic for me. I have to ...
Mark's user avatar
  • 7
0 votes
1 answer
536 views

Checking a string to see if it's an integer

I'm currently working on Caesar and I'm trying to go through each step in turn to complete it. As the problem set requires, I've written code that runs from the command line. The code below ...
sclemson's user avatar
0 votes
1 answer
106 views

CS50 Ceaser Validating Key

Trust you are well, I apologize for asking a question that's been asked before but I've been stuck on this for a while without any luck and finally realized I need help. I've attached my code of CS50 ...
Francois Louw's user avatar
0 votes
1 answer
65 views

Caesar 50 , no output!

I am writing code for caesar but when i am executing the program i am not getting any output and when i try to print integer values instead characters it is giving weird integer values, with this i ...
Bhavik Roopchandani's user avatar
0 votes
1 answer
163 views

Caesar - Problem set 2 - incorrect output

include // isalpha, isupper, islower - functions needed for caesar --- c = (p + k) %26 include // Check program is ran with only 1 command line arg. Check to make sure all characters are digits. ...
Ctouch's user avatar
  • 3
0 votes
0 answers
34 views

caesa cypherr cs50 pset2

I am having some issues with my code, clang continues to say use of a undeclared identifier when I have identified the variable that I would like to use. Can some one help me with this issue. My code ...
Keith's user avatar
  • 15
0 votes
0 answers
30 views

Caesar (Pset2): When i print out ciphertext, some additional characters, that are not supposed to be part of the array, print out. How do i fix that? [duplicate]

// Receive plaintext string text = get_string("plaintext: "); int t = strlen(text); char ciphertext[t]; //Array assignment for (int i = 0; i < t; i++) { // Plaintext to Ciphertext ...
Kalahari's user avatar
0 votes
1 answer
67 views

Hello! Could someone help me with problem set 2 caeser 2020, mistake is that problem accept non-numeric character

include include include include include int main(int argc, string argv[]) { int condition = true; for(int i = 0, n =(strlen(argv[1])); i < n; i++)// going through string { ...
Alisa Azimova's user avatar
0 votes
1 answer
952 views

problem set 2 caesar check :( handles non-numeric key timed out while waiting for program to exit

I have gotten my code to work for the caesar problem in problem set 2. However, when i check through check50 I run into this error: :( handles non-numeric key timed out while waiting for program ...
janecrager's user avatar
0 votes
1 answer
671 views

Segmentation fault in caesar

I am returning a segmentation fault with this code. The argc portion of the code is function correctly if i enter too many arguments returning "1". If the correct number of arguments are entered I ...
Rob Watt's user avatar
0 votes
1 answer
157 views

Why doesn't my Caesar code not return an output for the cipher text?

Can anyone help me out why my code won't return any cipher text, think it has something to do with the formula ci = (pi + k) % 26 I have done. Any help much appreciated. // Libraries #include <...
Andrewoca's user avatar
0 votes
0 answers
1k views

PSET2 Caesar : problem regarding non-numeric key

my code for Caesar works fine regarding the ciphering part but it won't pass the check50 because of the criteria "handles non-numeric key" and I have this message : "timed out while waiting for ...
Martinf's user avatar
0 votes
0 answers
74 views

pset2 caesar expected expression error

I can't understand this error. caesar.c:22:20: error: expected expression string p = get_string(); ^ /usr/include/cs50.h:109:53: note: expanded from macro 'get_string' ...
Ahmad ELZohairy's user avatar
0 votes
1 answer
69 views

Pset 2 Caesar "Expected Expression" - If statement

For the Caesar pset, I am having trouble trying to fixing an expected expression error. for (int i = 0; i < int n = strlen(argv[1]); i++) { printf("test"); } The condition inside the for-...
Maelgwn's user avatar
0 votes
1 answer
486 views

Caesar pset2 - using isdigit(argv[1][i]) only looks at the first character

I have read through the other posts where you need to use argv[1][i] when using isdigit to avoid the error. It does eliminate the error, but it is only reading the first character and stops. I can ...
Toni's user avatar
  • 1
0 votes
0 answers
93 views

segmentation error in caesar, I am unable to understand why

Here is my code: #include <stdio.h> #include <cs50.h> #include <math.h> #include <string.h> #include <stdlib.h> #include <ctype.h> int main(int argc, string argv[]...
Musical_Ant's user avatar
0 votes
1 answer
99 views

Problem with Pset2!

I'm really not sure why my code doesn't work for char's that are L, and when 20 is added to them on line 34. Appreciate the help for a beginning coder please:) int main(int argc, string argv[]) { //...
haowei's user avatar
  • 3
0 votes
1 answer
203 views

PSET 2 Caesar - Errors when key is a large number

// Converts Plain Text to Cipher Text int key; int prompt(void); int enicpher(void); // Takes User Command Line Arguments as Key if criteria are met int main(int argc, string argv[]) { // Throws ...
The_MidNight's user avatar
0 votes
1 answer
121 views

PS2 Caesar Algorithm

#include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> #include <stdlib.h> int main (int argc, string argv[]) { //Terminates if Command-line ...
yoyo Ahmed's user avatar
0 votes
1 answer
161 views

Caesar - Validating they Key

Hope you are doing well, a version of my question has already been asked and I went through some of those responses but it hasn’t helped so far. I am new to coding and working on the Caesar problem ...
mo_coder's user avatar
0 votes
1 answer
79 views

Pset 2 - "undefinedBehaviorSanitizer:DEADLYSIGNAL"

So I am on Pset 2, the caesar problem. So far, function main checks to see if there is one command line argument, none, or two or more. I am trying to implement code so that an error is returned if ...
owwix's user avatar
  • 5
0 votes
1 answer
71 views

Pset2 caesar: Issue with check50

The output is right, but check50 says that it is wrong]1 [removed code per academic honesty guidelines]
Igor Rocha's user avatar
0 votes
2 answers
121 views

Caesar - unexpected results - weird character added to cypher

My code seems to be working but when I enter only one or few characters in my plaintext, my cyphertext returns weird characters... I had a look at my code and try couple of solutions and I can see ...
Xavier LeVin's user avatar
0 votes
1 answer
59 views

Unaccepted output with caesar

I am not getting the desired output when I want cipher the plaintext with key 13 with long sentence with commas and space. Please help, thank you. //Program to encrypt the message by using Caesar'...
BMavhungu's user avatar
0 votes
1 answer
24 views

Output keeps changing with each execution of caesar (and none of them is correct)

I've written the following code: …………………..…………………………………………………………………………………………... #include #include #include #include int main(int argc, string argv[]) { if (argc != 2) { ...
Musical_Ant's user avatar
0 votes
1 answer
70 views

(Caesar) My output is completely correct and satisfies every mentioned case, But my score is only 46%. Why?

I had already submitted Caesar once and got 45%. I corrected the code, the output, but the score is now improved to 46%. Here's the code : #include <cs50.h> #include <stdio.h> #include &...
Yuvan Seth's user avatar
0 votes
0 answers
145 views

Submit50 & Check50 not submitting most upto date version of pset

I've been attempting to submit my Caesar cipher solution to no avail; my first submit worked fine but then I noticed that my code was well full of bugs. So, I fixed it, and submitted again. Following ...
Douglas G. Wright III's user avatar
0 votes
1 answer
42 views

In pset2, Vigenere, I made and used an array that I would like for it to be explained

I’ve successfully solved Caesar and Vigenere pset but made and used an array that I stumbled upon through trial and error but don’t exactly know why and how it worked. I’m hoping someone could clarify ...
Jovanovic's user avatar
0 votes
1 answer
477 views

PSet 2: Caesar, validating key

I'm struggling with the output to the "Validating Caesar's Key" part of PSet 2. First-timer here, like many, and appreciative of any insight. When I compile and then run this program with "./caesar 2",...
LippStick's user avatar
0 votes
1 answer
165 views

when i run ./caesar it give me strange error i don't understand

caesar.c:9:20: runtime error: null pointer passed as argument 1, which is declared to never be null /usr/include/stdlib.h:105:33: note: nonnull attribute specified here UndefinedBehaviorSanitizer:...
ox0o's user avatar
  • 33
0 votes
1 answer
46 views

Caesar in Python

On cs50 IDE, for problem set 6 Caesar, it keeps saying my program is wrong and giving me a 37% but it compiles perfectly. I checked with check50 and everything it say's it doesn't do it does precisely....
user avatar
0 votes
1 answer
75 views

Error message: 21:9: error: expected expression else

I keep getting the above error: #include <cs50.h> #include <ctype.h> #include <stdio.h> #include <string.h> int main (int argc, string argv[]) { if (argc != 2) { ...
user11913821's user avatar
0 votes
2 answers
1k views

Caesar - Validating key using isdigit

I keep getting this error: caesar.c:17:13: error: subscript of pointer to function type 'int (int)' if (isdigit[i] == 0) This is my code: #include <cs50.h> #include <ctype.h> #...
user11913821's user avatar
0 votes
1 answer
119 views

My solution to Pset2's Caesar works but I only got 40% on it. Why?

I worked my way through Caesar as well as Vignere in PSet2. I got a score of 99% for Vignere but only 40% on Caesar, which is really strange as I worked off of Caesar for Vigenere.. If anyone could ...
Anjali Radhakrishnan's user avatar
0 votes
1 answer
865 views

c:30:25: error: invalid operands to binary expression ('char *' and 'string' (aka 'char *'))

Hey guys could someone advice me on the flaws in the following line of code. I'm visited by the following error message: c:30:25: error: invalid operands to binary expression ('char *' and '...
Lim Dion's user avatar
0 votes
1 answer
253 views

PSet 2: Code successfully compiled but does not meet desirec requirement

In this problem set, we are supposed to obtain one argument ( which omprises of digits), failing which, the user are prompted with a message, "Usage: ./caesar key". I have attached the problem ...
Lim Dion's user avatar
0 votes
1 answer
103 views

CS50 Problem Set 2 Code Not Fully Executing

I am trying to get the code to check that: 1) Only a numerical argument is passed through 2) If a non-numerical, number is pass through, an error message is revealed to the user. Here are the ...
Lim Dion's user avatar
0 votes
1 answer
36 views

Why is strlen unexpectedly increasing on iteration 7?

I am looping through a string one character at a time, assigning the value of a[i] to b[i]. (Once I crack this bug in my code, my intention is to modify a[i] algorithmically to a[i] + key % 26...) ...
perucoder's user avatar
0 votes
1 answer
99 views

Validation bug on caesar, repeating loop error for more than one digit key

After spending many hours on caesar, I have restarted from nothing several times and think my program is able to correctly validated the key given by the user. The problem is that my validation only ...
Hans's user avatar
  • 1

1 2
3
4 5
9