Hot answers tagged

2 votes

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

GOT IT! you need to format - if comparing hex, need to say 0x34 not 34.
user avatar
  • 35
1 vote

Comparing chars

Your problem is much more basic and simple. Look at these lines: char x; // a char variable char *y; // a pointer to a string y = "a"; // loads a string into memory at y if ...
user avatar
  • 64.2k
1 vote
Accepted

Problem in C programming about condition

You can check for equality if it is a float a = 10.00; or int b = 10; or char c = 'a' or any other datatype variables like short,long, unsigned int but that is not the case for a string or char[] ...
user avatar
  • 26
1 vote

Problem in C programming about condition

You're having problems because you can't use "==" to compare strings. You need to use a function call to strcmp() or maybe strcasecmp() It's a very, very common mistake by new programmers. ...
user avatar
  • 64.2k
1 vote
Accepted

How does compare2.c work?

When compare_strings is called, notice that the first part of the function checks to see if the 2 strings have the same length. If they don't, the function immediately ends with return false; The ...
user avatar
  • 18.4k
1 vote
Accepted

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

The compare python program is for running on the command line, so you can test your helpers.py functions that you've written. It is unrelated to the web-based application.
user avatar
  • 18.4k

Only top scored, non community-wiki answers of a minimum length are eligible