2

Your word comparison appears to be case insensitive. What about your hash function? Is it case sensitive? ;-) If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)


2

What is happening there, is that you did your word count asuming that the next caracter would be alphabetical, here: al = isalpha(text[i + 1]);, but in this case, the next caracter are quotation marks so it's not counting a couple of words.


1

For starters, the first while statement isn't incrementing block_counter, so the code is just overwriting the first 512 bytes of block over and over until it only contains the last 512 bytes of the input file. Since there's no signature found ever, no output is generated. There may be other issues, but this will get you back on track and give you the chance ...


1

You've got a few different problems. First, take a look at your first call to fopen(). You call it again to check if the result is NULL, but that's incorrect. Instead, try declaring a variable with the result of calling fopen(): FILE *ptr = fopen(dictionary, "r"); Then you can check with an if statement if ptr is equal to NULL. As Cliff said ...


1

Let's talk about how you're using the hash function first. Here's your code: hash(word) Ignoring the missing semicolon, this is a normal function call. Since hash() returns an int, the code needs to do something with that int, like assigning it to an int var. Surely you know how to do that by now. As for the hash function itself, it's using some ...


1

I think it's just an invitation for you to be able to pass the psets. When you pass psets it should be saved to a private repository of your github the link should just be github.com/me50/YourUsername


1

For grayscale you should take a look to operator precedence in C (google). The result 'a + b / c' is not the same than '(a + b) / c' For reflect a question: How many swaps do you need to do to flip the image horizontaly? Think about it. For blur you've found a way to go over the 3x3 pixels around the current pixel with your loops 'k' and 'l', and then ...


1

You need to read the report more carefully. Yes, 7 coins for $1.60 would be correct. But the problem is the return value that the program is sending. The spec says to print the number of coins, not to return it when the program completes. The normal practice is that a program should return 0; when a program completes successfully, and to return a non-zero ...


1

The problem is this line: return change; For the main() function you're supposed to return 1 if there's been an error, or 0 if succeed.


1

I missed a += on the rgbtGreen :S


1

The variables that you create in the for loops only exist within that for loop. You can use the result of a certain iteration of a for loop by eg: including an if function within the for loop to pick up what you are after .


1

It's a scope problem: When you declare a variable inside a 'for' loop or a function, it only will be available until the loop/function ends. For example in your for loop: for(int i=0;text[i]!='\0';i++) as 'i' is declared and inicialized at the begining of the for loop, as soon as the loop finishes, it'll be destroyed and you won't be able to access to it ...


1

In the line changeOwed = changeOwed - biggestCoin;, you subtract a function from an integer. I assume you meant changeOwed = changeOwed - biggestCoin(changeOwed) instead, subtracting the return value of the function call instead. After fixing that compiler error, what happens in your code if someone enters 0?


1

for (int i = 0; i < height; i++) { for (int j = 1; j < width; j++) { Your j variable here shouldn't start at 1.


1

If it’s red it means you have not summited all the pset’s so you need to check which pset is marked as unfinished


1

isdigit(k) is testing whether the ascii value of k is in the range of 48 - 57. Those are the ascii representations of '0' through '9'; here is an ascii table for your review. But k is an integer from this declaration int k = atoi(argv[1]);, therefore isdigit(k) always returns 0. Program should test that each character of argv[1] is a "digit", ie argv[1][i]....


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