Skip to main content

Questions tagged [boolean]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
53 views

Are boolean variables left uninitialized true or false?

I have a question about why something is being done in the provided stub code for Tideman. here bool locked[MAX][MAX] is left uninitialized early in the program when it is declared. Later every ...
Yuya Ito's user avatar
0 votes
1 answer
12 views

Do computers have to check if (false) the same way as whether (0 != 0), etc.?

I found Edges to be a double-edged assignment. As I were to have the machine iterate over thousands of pixels to make computations, I figured I should try to minimise the amount of operations per ...
VMČ's user avatar
  • 3
0 votes
1 answer
103 views

Week 2 Lecture - Functions - Valid Triangle

This is from the functions lecture on a valid triangle. I'm not getting any error messages but I can't figure out why the bool valid_triangle (float x, float y, float z) function is not working. Any ...
Leonidas Smiley's user avatar
0 votes
1 answer
67 views

Week 2: valid_triangle function example -- compiling [errors]

This goes to week 2: Functions mini lecture. We create a custom function for verifying whether we have a valid triangle by assessing it's 3 sides. I wanted to elaborate on the code. Since, this ...
Michael_Epstein's user avatar
0 votes
2 answers
78 views

Else If Boolean Statements of Equality In the Case of Complex Numbers

In the lecture for Week 1, Professor Malan said that in an if statement, the third boolean expression (else if (x ==y)) is redundant or implied, since logically, if it is false that a number is ...
Varsha 's user avatar
0 votes
1 answer
42 views

What's in the bool function parenthesis?

hope everyone is staying safe. I just want to understand what's inside the parenthesis of the vote function in pset3 - Tideman: bool vote(int rank, string name, int ranks[]) What does it mean to ...
ZeevKeane's user avatar
0 votes
1 answer
47 views

Pset3 is_rest does not compile right?

I have some code I have written to test whether a blank line has been reached in the music file but I am not familiar with how to return a Boolean statement as true in C. When I run make I am getting ...
kwjamesblond's user avatar
0 votes
1 answer
311 views

What is the return value when isalpha() evaluates to true?

I was running into an issue with my program for Vigenere's Cipher and singled it out to a problem with the equivalence of the value that is returned from isalpha() and the boolean "true". I now know ...
jos0909's user avatar
1 vote
2 answers
110 views

Pset4 recover.c compiles, but can't seem to print Jpgs at all

Am starting a new thread as I'm having trouble understanding what is wrong with the code.. I've added printf statements at the jpgCheck function and did not get a print. I suspect it's the function? ...
olafironfoot's user avatar
2 votes
2 answers
747 views

Pset4 recover, comparing hex in if statements

I'm trying to solve "recover" but, I'm unable to compare my if statements. This is my error message: error: comparison of constant 224 with expression of type 'char' is always false [-...
olafironfoot's user avatar
0 votes
1 answer
95 views

pset2 caeser boolean returns

when running the code below with a command line ./caesartest 2, I get the false return 1, not the true, what is wrong? (I began having the trouble after including isdigit)... #include <cs50.h> #...
Samir-B's user avatar
  • 11
0 votes
1 answer
173 views

A question about boolean expressions

I want to ask if there is a way to tell your programme to proceed with the code only when a boolean expression is false (not "true" as usual) and if the answer is yes, could you give me an example of ...
Petar Petrov's user avatar
0 votes
1 answer
1k views

PSET8 - MASHUP : Can't find FULLTEXT indexes when using WITH QUERY EXPANSION

I'm working on the final pset, more specifically on the search.php file. I've figured out how to use query() and I'm actually taking advantage of print(json_encode($places, JSON_PRETTY_PRINT)); to ...
DFATPUNK's user avatar
  • 155
1 vote
1 answer
87 views

code doesn'work, please help

I tried to write this little piece of code, but I couldn't figure it out entirely. Can someone help me with the missing parts? #include <stdio.h> #include <cs50.h> int main(void) { ...
newbie's user avatar
  • 11