All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
7 views

PSet3 Plurality - Segmentation Fault when exiting main

My code seems to function properly until I try to exit main. At this point it reports a segmentation fault. This only occurs when there is a tie. Here is my code: #include <stdio.h> #include <...
user avatar
0 votes
1 answer
6 views

Running an 'if' statement inside of a 'for' loop; Need to continue loop w/o printing anything, but not sure what value to return

So, I'm currently working on 'Substitution', and have written the following code to evaluate if a certain array of characters are all alphabetic: for (int i = 0; i < length; i++) { if (isalpha(...
user avatar
  • 1
0 votes
0 answers
4 views

Lab3 correct structure to answer the questions

Does anybody knows what's the correct structure to answer the Lab 3 Answer.txt? i have tried with what i thought is the correct answer and this is what i get: :( correctly identifies each sort ...
user avatar
  • 101
0 votes
0 answers
5 views

cs50 dna pset6 2022. My code works on small database but not on large database

This is my solution to CS50 pset6 DNA problem in python. It works fine on small database but gives an Index error: List Index Out of range. I have tried print on various variables but can't figure out ...
user avatar
0 votes
2 answers
17 views

PS5 speller memory trouble

I have a strange problem with the below code for PS5 speller. I have can match the requested output, it is fast enough, that is all good. However I am having a persistent valgrind issue where I am ...
user avatar
0 votes
1 answer
21 views

Speller Error - free(): double free detected in tcache 2 Aborted (core dumped)

// Implements a dictionary's functionality #include <ctype.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <strings.h> #include <string.h> ...
user avatar
0 votes
1 answer
15 views

CS50 Pset2 Substitution "expected prompt for input, found none"

When I run the code manually, everything works fine: [snipped out code] { if (isalpha(argv[1][i])) { //Check that each character is only ...
user avatar
  • 5
0 votes
1 answer
16 views

Trying to reject repeated characters in pset 2 substitution

i can't find out what's wrong with the code i wrote.when i execute ./substitution VCHPRZGJNTLSKFBDQWAXEUYMOI in terminal,it still prompts "Key must not contain repeated characters." #include ...
user avatar
0 votes
0 answers
5 views

Gcc problem - C lang - visual studio code

I recently got into the CS50 course and they begin to work on the C lang, so when I tried to write the same tags and run it on the Terminal it give me ( Gcc is no recognized). Please can anyone helpe ...
user avatar
0 votes
0 answers
7 views

Why do I get the path error to view the contents of a single email in the below code.?

In the inbox.js file I am trying to listen for a click event for each email single_email_div and send it to the email view in views.py inbox.js function load_mailbox(mailbox) { // Show the mailbox ...
user avatar
  • 1
0 votes
0 answers
5 views

could you help?

I have a problem with the selection code. it is compiler right .but not give the right order it give me the order blow : ~/sel_sort/ $ ./sort array after selcation sort : arry[0] = 4 arry[1] = 6 arry[...
user avatar
0 votes
0 answers
8 views

my check and size functions are having problems and check50 returns all frowns

// Implements a dictionary's functionality #include <ctype.h> #include <stdbool.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> #...
user avatar
0 votes
0 answers
17 views

Problem Set 3: Runoff - Tabulate Errors

I get the following errors on check50: :( tabulate counts votes when multiple candidates are eliminated and :( tabulate handles multiple rounds of preferences. I have run debug50 but it gets me ...
user avatar
0 votes
1 answer
16 views

Solved: Little Professor claims my program doesn't output a score in the end

So every other check50 test passes, but for some reason not thr one with scire and I can't understand why. My code: import random def main(): i=0 lvl=get_level() correct=0 while(i<10): ...
user avatar
0 votes
0 answers
6 views

error with check50

menu = { "Baja Taco": 4.00, "Burrito": 7.50, "Bowl": 8.50, "Nachos": 11.00, "Quesadilla": 8.50, "Super Burrito": 8.50, "Super ...
user avatar
  • 1
0 votes
0 answers
13 views

Week 8 - Lab - Trivia

I have completed the lab and my page works, but I had to move my javascript around the page, and I can't work out why. I tried use the DOMContentLoaded approach, but code within that function wouldn't ...
user avatar
0 votes
1 answer
17 views

Codespace for CS50 it´s not working properly: "Rebuild Container"

When I try to enter "code.cs50.io" this is the message appears. Once inside, I cant run commands like "make" and it seems thats because "codespace is running in recovery mode&...
user avatar
0 votes
1 answer
20 views

Pset4 (Filter-Less) Reflection: Not getting correct values on Check50

Image seems to be reflected correctly but the program doesn't pass check50. Code: void swap(RGBTRIPLE *a, RGBTRIPLE *b); void reflect(int height, int width, RGBTRIPLE image[height][width]) { for (...
user avatar
0 votes
1 answer
12 views

Pset4 (Filter-Less) Greyscale not passing check50

I tried implementing the GreyScale function but I didn't got the average values of the pixels correctly. I don't know what I'm doing wrong. Any hints will be appreciated. My code: void grayscale(int ...
user avatar
0 votes
1 answer
22 views

Use of bool in PSET2

So i'm trying to approach this pset using functions more than i have in previous attempts. the hints suggested to use bool to check if key is valid. my code compiles and all the rest of the parts ...
user avatar
  • 1
0 votes
1 answer
9 views

Error when calling seconnd function - expected expression

I'm trying to call my encryption function and am getting an undeclared identifier error. Not sure where i'm going wrong. Code: #include <cs50.h> #include <stdio.h> #include <ctype.h> ...
user avatar
  • 1
0 votes
0 answers
17 views

how to prevent input type from being definite type?

i am including cs50 library in my circle calculator so i can get get input from user about operation(circumference/area/volume)then radius,so i want to make sure that first input is number from 1 to 3 ...
user avatar
0 votes
1 answer
34 views

Filter (more) blur function fails check50

I've hit a bit of a brick wall writing a blur function for filter (more). This is my second go at refactoring the code, and although it produces a blurred image without any issues (no weird edges, ...
user avatar
  • 103
0 votes
1 answer
28 views

CS50 Readability solution unsolvable to me

I coded this solution myself, but I really can't figure out where I did wrong, I've spent days on this, and I would really appreciate any help!! Please, 😭 #include <cs50.h> #include <stdio.h&...
user avatar
  • 1
-1 votes
1 answer
17 views

terminal isnt working

My terminal started to look like this. I am unable to use check50 or submit50 and cant change directory.
user avatar
0 votes
1 answer
14 views

I've tried everything I can think of to get any other Answer out of this program. Please help! Unexpected never ending loop

#include <cs50.h> #include <stdio.h> #include <math.h> #include <stdlib.h> int cclengthfinder(long x) { return x == 0 ? 1 : (int)(log(labs(x)) / log(10)) + 1;} // This a ...
user avatar
0 votes
1 answer
28 views

Segmentation fault (core dumped) after main returns 0

Im getting seg fault after my main functions returns 0, only when I pass lowercase cipher key, Ive run debug50 and the code ran fine, expected output but when it reaches the return statement in the ...
user avatar
  • 3
0 votes
1 answer
15 views

CS50x PSET4 (Filter) - BLUR

This code is supposed to blur an image together with other supporting files as per CS50 Pset4. I am able to compile my code with no errors and run the program but it does not seem to blur my image ...
user avatar
0 votes
0 answers
12 views

trouble with ssh authentication in submit50

I am having problems with check50 and submit50, they both fail due to github authentication, yet they worked yesterday, and there was no change done before they stopped working. It gives me these logs ...
user avatar
0 votes
0 answers
13 views

Need help with my terminal, I have been strugggling with it one day😭

I don't know what's wrong with my terminal today. Where is my dollar sign??? With these weird" /workspace/..#", I run ./sort1 reversed10000.txt and the output wil be time: can't execute './...
user avatar
  • 1
0 votes
3 answers
73 views

PSET5 Speller: Check50 Can't Compile: Exit code 2 vs 0

At my wit's end here. I've seen this question asked before, but I haven't really found an answer. My speller program compiles perfectly fine in the VS Code workspace. It generates the same results as ...
user avatar
0 votes
1 answer
10 views

error in terminal uppon submiting

playback/ $ submit50 usage: submit50 [-h] [--logout] [--log-level {debug,info,warning,error}] [-V] slug submit50: error: the following arguments are required: slug
user avatar
  • 1
0 votes
0 answers
16 views

Why the pointer value changed in here?

from my understanding for pointers in c, when we use a pointer for string, it refers to the address of the [0] element of that string, which means this 4 lines of code should be the same result: char *...
user avatar
  • 1
0 votes
0 answers
11 views

Assignment 6 on Web Development for CS50T

Assignment 6 on Web Development for CS50T requires me to copy the url of my repl. How do i do that and how should that url be?
user avatar
0 votes
0 answers
5 views

malloc less amount of memory than needed but still works?

So I was just playing around with malloc() modifying the code given by David in Week 4's lecture. #include <stdio.h> #include <string.h> #include <stdlib.h> int main(void) { ...
user avatar
0 votes
0 answers
6 views

CS50 programming github

Whilst I am trying to debug and run my code on the codespace I am receiving this message. I am not sure how to solve this problem and when I click "launch.json" it takes me to a page I do ...
user avatar
0 votes
1 answer
72 views

CS50P PSET3 outdated.py

I can't seem to get passed PSET3 outdated.py. I get two errors when running the check50 command: :( input of " 9/8/1636 " outputs 1636-09-08 expected "1636-09-08", not "1636 -...
user avatar
0 votes
1 answer
10 views

When I type python ~~.py, the output on the terminal is just "Python", not the ones that I wanted it to be printed out

Just like you could see in the picture, it appears to work just fine when I run the file by clicking the button above. But if I type python hello.py, the the outcome on the terminal is just "...
user avatar
0 votes
0 answers
10 views

Using CS50's tools on local Windows machine with MSYS2

I am taking CS50's Introduction to Computer Science Course, currently on week "3" - Algorithms. My machine is running windows 10 with MSYS2 for providing the linux like tools. I have tried ...
user avatar
0 votes
0 answers
7 views

CS50 Blur Question. I have no idea why my get blur in the middle function does not work?

// Blur image void blur(int height, int width, RGBTRIPLE image[height][width]) { //Create a copy of image RGBTRIPLE copy [height][width]; int i, j; int redAverage, blueAverage, greenAverage; for (i = ...
user avatar
0 votes
1 answer
10 views

pset 1 mario less. My Code is printing in single row. I cant find what wrong with it

#include <cs50.h> #include <stdio.h> int main(void) { int n; do { n = get_int("Height: "); } while ((n < 1) || (n > 8)); for(int i = 0; i &...
user avatar
0 votes
1 answer
14 views

declaration shadows a variable in the global scope [-Werror,-Wshadow]

#include <cs50.h> #include <stdio.h> int get_cents(void); int calculate_quarters(int cents); int calculate_dimes(int cents); int calculate_nickels(int cents); int calculate_pennies(int ...
user avatar
0 votes
1 answer
25 views

Speller pset 5 my code is not working for substrings

I'm not sure why this is happening especially because it doesn't happen for cat #include <ctype.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <...
user avatar
0 votes
1 answer
9 views

Lab4 fread() and fwrite() problem

can anybody tell me what is wrong with this code block. When i use check50 it fails all three objectives. h_buffer: header buffer s_buffer: sample buffer // TODO: Copy header from input file to output ...
user avatar
  • 1
0 votes
1 answer
16 views

random rgbt number in pset4 filter

I used the walkthrough's example of an image to simplify things (6 x 6 image with a red cross in the middle and blue corners). I manually used debug50 on the indexes(i = 1)(j = 1) to check what ...
user avatar
  • 3
0 votes
0 answers
7 views

CS50 Wiki Project-edit function-entry doens´t exist

my wiki project edit function doesn´t work and shows entry doesn´t exist, if anybody can find out what is the problem? urls.py from . import views urlpatterns = [ path("", views.index, ...
user avatar
  • 1
0 votes
0 answers
29 views

PSET 8: Homepage

I'm on week 8 (pset: homepage) from CS50 and I have this problem: I can't add more than 1 jpeg to my homepage folder, because the server won't work. I tried downsizing all images, but it still doesn't ...
user avatar
  • 3
0 votes
0 answers
22 views

Ciphertext is not working

#include <cs50.h> #include <stdio.h> #include <ctype.h> #include <string.h> #include <stdlib.h> int main(int argc, string argv[]) { //program can only run with one ...
user avatar
0 votes
1 answer
61 views

PS6 Lines Of Code :( lines.py yields 2058 given 2058 lines of code in an open-source library file

I was wondering how to solve the last check on Lines of Code. Expected Output: 2058 Actual Output: Too few command-line arguments I recreated the file 2058.py with 2058 lines of code, and it worked. ...
user avatar
0 votes
1 answer
3 views

PSET2 "linker command failed with exit code 1"

So I was working on the Caesars problem trying to check that every character in argv[1] is a digit when i get this error trying to compile it: `/usr/bin/ld: /tmp/caesar-d6b46b.o: in function 'main': /...
user avatar

15 30 50 per page
1
2 3 4 5
260