2

Did the instructions say to print "What is your full name?" One of the hidden lessons of the first few psets is to write the code exactly to the specification. Any extra or missing prompts, spaces, text, chars, whitespace, line feeds, etc., will trigger a fail. If this answers your question, please click on the check mark to accept. Let's keep up on forum ...


2

Look at this code: int h = get_positive_int("What height do you want: "); //print the pyramid for (int h = 0; h < n; h++) It declares h (as an int) twice. Change one of them. Also, n hasn't been declared before being used. Maybe you meant the first one to be n and not h? There are other issues that you'll discover, but this answers the specific ...


1

In the pset we have several files, if you look closely at the specifications, there is a special file called makefile, and what we have to write to the compiler is: make filter


1

Have you actually looked at the raw hex data contained in the program's output files? Notice anything interesting? Where is the bmp signature that's supposed to be in the first 2 bytes? Next question: Which header is supposed to be printed out first, bi or bf? ;-)


1

Interesting. I ran a test using a small dictionary and noted immediately that the only words that were coming back as correct were the ones pointed to by the pointers in hashtable. Anything that wasn't the first node in a linked list was misspelled. This is as often a problem with load() as it is with check(), but let's look at the heart of check() first. ...


1

What is "this" EOF error? Please provide more context so we know what you are talking about. If it is a failing check50 test case, the link check50 provides can often tell more. If not, specify how the programme misbehaves. This is even better, as you try to understand what the programme should do. Some people build their solution around the test cases, and ...


1

int npadding = (4 - (bi.biWidth * sizeof(RGBTRIPLE)) % 4) % 4; should use nbi, not bi. That's why n=1 and n=5 don't complain about the header, those values are always equal then. lineIterator is never incremented and stays at 0. Increment it, for example using for (int x = 0; x < n; x++, lineIterator++) line[lineIterator] = ...


1

The problems start here: the code modifies bi.biWidth and bi.biHeight for the output file and then uses them to control the processing of the input file. Say that n=2. That means that its going to read roughly two full lines from the input as one line and then will try to read twice the size of the input image, which usually results in the bottom half of ...


1

Check the usage section of the initals page here: http://docs.cs50.net/problems/initials/less/initials.html Although your solution may be more user friendly, the problem does not expect you to prompt the user for their name. Thus when you run check50 it is expecting you to type your name after you run ./initials and when it instead receives your output ...


1

The specification says to determine what header fields need to be updated. There are fields in the headers other than biWidth and biHeight that must be modified when n != 1. I don't see any code to deal with them. If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)


1

The headers of the new image have biSizeImage and bfSize values of the original.


1

Use while (left <= right) to loop as long as the search interval has elements. No need for break;. You compare value value to index middle, but you have to compare value value to middle value values[middle]. You need three cases, one for ==, one for <, one for > (the actions seem correct, though, just the conditions aren't) You're trying to ...


1

Please access argv[1] only after you have verified that argc>1, otherwise atoi dereferences arbitrary value, and you might get random segfaults if calling the programme without arguments. How do padding and newpadding differ? In your code, both are calculated based on the resized image's width. You don't want to change the bi.biHeight's sign, so no abs ...


1

Your output has an extra space in every row. The bottom should be flush against the left side.


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