Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 28078
0 votes

PSET4 recover. Why doesn't my counter increase?

Try using else-if instead of the ifs. Also, instead of putting 1 inside the while bracket, try putting &free or true. If this helped, please click on the tick mark.
Vsjain's user avatar
  • 1,031
0 votes

error: result of comparison of constant with boolean expression is always true

Instead of long, use unsigned long long int to hold very long numbers. Check out man.cs50.io for a function to take a long long int. If this helped, please click the tick mark.
Vsjain's user avatar
  • 1,031
0 votes

PSET 6 DNA: How to get number of repeats for each value of STR's? [SPOILER: Full code]

The loops are all correct. Put long_str[key] = long_run inside the for loop like this: for key in long_str: i = 0 run = 0 long_run = 0 while i < len(sequence_dn …
Vsjain's user avatar
  • 1,031
1 vote

How can I check my number of rows on pset7 movies?

You can also count the number of rows using SELECT COUNT(title) instead of SELECT title in the query.
Vsjain's user avatar
  • 1,031
1 vote
Accepted

Error in CS50 IDE Terminal

It happens some times. It is still in the substitution directory. If you are not sure then type cd in the terminal and then type cd pset2/substitution in the terminal. If this helps please check the t …
Vsjain's user avatar
  • 1,031
1 vote
Accepted

reflect for cs50. Trying to reflect an image, but only the first row pixels is swaped

The problem is that you are decreasing the width. Instead of using width - 1, use width - j - 1. Eliminate the width--; line at the end of the inner loop. Also, instead of using j<width use j<(width/2 …
Vsjain's user avatar
  • 1,031
1 vote
Accepted

pset9 buy function // buy handles invalid ticker symbol and handles valid purchase having error

Quote and stocks are one and the same. So you should keep only one of them. Your first error takes place at price = quote.get("price"). This line is correct but in the wrong place. Once you have check …
Vsjain's user avatar
  • 1,031
1 vote
Accepted

pset9 // register function not registering user

The problem is simple. Your placeholder for hash in the sql insert statement is hash but then you have used hash_p instead of hash when assigning the value. Hope this helps. If it does then please che …
Vsjain's user avatar
  • 1,031
0 votes

CS50 PSet 4 Recover, Segmentation Fault

It is not able to check if a jpeg has already been opened or not. For this, set as if-else where you check if counter is 0 or greater than 0. if it is greater than zero, fwrite, else break. …
Vsjain's user avatar
  • 1,031
0 votes

Recover function in pset4

You have made an if statement, an else if statement, but not an else statement to finish the loop. Also try running your program part by part to identify any other problems. If this helped, please cl …
Vsjain's user avatar
  • 1,031
1 vote
Accepted

My load function is licking memory

Close the file at the end of the function. This will prevent memory leakage. If this helps, please check the tickmark.
Vsjain's user avatar
  • 1,031