New answers tagged

1 vote
Accepted

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

Be very careful here if (argv[k] == argv[r]) argv is the array of command line arguments. As such, argv[0] is ./substitution, argv[1] is the key, and argv[2] hits memory that doesn't belong to your ...
user avatar
  • 18.4k
1 vote

Use of bool in PSET2

Your use of bool is correct, subject to the real problem. The function call isn't. I think your mind just got stuck using a pattern though. Look at the following code: // Make sure every character ...
user avatar
  • 63.5k
0 votes

Error when calling seconnd function - expected expression

It's a scope issue. k is declared inside the curly braces of the FOR loop. That means that when the code exits the for loop, k will cease to exist. K should be declared outside of any loops or if ...
user avatar
  • 63.5k
0 votes

CS50 Readability solution unsolvable to me

I can understand why you're having trouble fixing this. The good news is that it's an easy fix once you know what to look at. Here's a really, really big hint: In c programming, what's the difference ...
user avatar
  • 63.5k

Top 50 recent answers are included