Questions tagged [compare]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
22 views

Problem in C programming about condition

Well, I am learning C programming.Today I faced a problem while coding. I have made a string variable named,"answer". But when I wrote a condition, I found an error message but I don't know ...
1
vote
1answer
16 views

How does compare2.c work?

I'm just watching lecture 3 right now and I can't understand how is compare_strings works. It has for loop that comparing if i < n and n = strlen(a), so if i'm passing name like David strlen(a) ...
0
votes
1answer
110 views

PSET 6 [Similarities - less] How is the compare file accessed in this problem since it is not imported to application.py

(Dont be intimidated by length of code chunks, I included all of my guess as to what's going on, so most of it is just stuff to skim over) The folder similarities contains static and template folders ...
0
votes
1answer
67 views

What is if __name__ == “__main__”: doing in compare pset6?

I read the documentation, but I still can't pinpoint exactly what it is this line of code is doing in compare. The code of compare is as follows: #!/usr/bin/env python3 import argparse import re ...
0
votes
1answer
285 views

Similarities Pset6 - submit button not working

Quick question. My code passes check50 and submit50 but for whatever reason I can't seem to get the actual program to work i.e. when I click the compare button on my form nothing happens. Here is my ...
0
votes
1answer
70 views

how do i compare the result of an fread to a hex value?

fread(&quad, sizeof(FIRSTFOUR), 1, inptr); so I get the first four bytes (FIRSTFOUR is a struct with four BYTES defined first, second, third, fourth) but how do I compare quad.first to oxff, etc???...
0
votes
1answer
211 views

Comparing chars

I'm trying to write some code that will take input, loop through the characters in the input, and print "hi" for every "a" that shows up in the input. I'm getting errors trying to compare the looped ...