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 ...
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 ...
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? ;-)
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.
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 ...
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] = ...
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 ...
Check the usage section of the initals page here:
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 ...
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. ;-)
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 ...
Please access argv 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 ...