Questions tagged [headers]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
14 views

Creating my own Header file

I am at pset3 and I decided to try creating my own mergeSort header file. This is something that I have never attempted and haven't learned much about yet so I am at a loss. I have created the the ...
0
votes
1answer
78 views

pset4, resize. Why does my change of headers create images that say invalid/unsupported image format?

I have looked through many of the same questions but come up with no answers. I am solely focusing at the moment on changing the headers and have tried to get calculations correct but something must ...
0
votes
1answer
83 views

Changing file header- Invalid or unsupported format

I am having problem with changing file header. Specifically: BITMAPINFOHEADER new_bi; fread(&new_bi, sizeof(BITMAPINFOHEADER), 1, inptr); BITMAPFILEHEADER new_bf; fread(&...
0
votes
1answer
216 views

Why do we write #include “structs.h”?

Why do we have to include the header structs.h every time we use structures? Why it should be included as #include "structs.h" not as #include <structs.h>?
0
votes
1answer
137 views

Pset4 Resize Horizontal Not Working

I am currently undertaking the horizontal resizing in pset4 resize. Although I believe my code is sound, it does not resize small.bmp, and instead turns it into a gray block of the same size. I am not ...
0
votes
1answer
62 views

How to get list of function signatures from header files

Working through PSET1 - Credit. I'm coming to CS50 with experience in languages other than C, with strong documentation, and it would be really helpful to be able to generate a list of function ...
0
votes
1answer
45 views

Issue with creation of new header files in pset4

//create new BITMAPINFOHEADER details BITMAPINFOHEADER bi_new; bi_new.biHeight = bi.biHeight * factor; bi_new.biWidth = bi.biWidth * factor; // determine padding for infile scanlines ...
0
votes
2answers
140 views

Problem with outfile's header

I am getting Error -254 ,Have i defined my outfile's header correctly? // write outfile's BITMAPFILEHEADER BITMAPFILEHEADER bf_resize; BITMAPINFOHEADER bi_resize; bi_resize.biWidth=bi.biWidth*n; ...
2
votes
1answer
184 views

Header Problem in Resize

There is some serious flaw in the header file code of my program since all the variables that was required to be modified is showing error while running the peek program (as shown in in the screenshot ...
0
votes
1answer
178 views

Resize - output files look right but check50 gives errors

I'm running resize. The headers are right when I check them using peek. The files look right (smiley, small, even whodunit). But when I run check50 I get these errors: :( resizes 1x1-pixel BMP to ...
1
vote
1answer
329 views

PSET5 - Issues with initialization of pointers in LOAD function

I'm still trying to debug my load function, I rewrite my code again and again but with no result... I know we need to have specific question, but now I just have so many questions. So, I'll go with ...
0
votes
0answers
671 views

Problem with header data, biSizeImage and bfSize have values of small.bmp

So my code is working fine - images resize exactly as they should (as far as my eye can tell) for images both with and without padding, but my header data is wrong when I compare to staff.bmp. My ...
1
vote
1answer
1k views

Problem with header data in resize.c

My resize.c runs just fine in the terminal, but the newly-created 'resized' image is broken: no image is displayed, and the message 'bogus header data' is shown. I changed the header files like so in ...
2
votes
1answer
558 views

How do the headers in copy.c update on pset4?

I don't really understand the following code in copy.c: // write outfile's BITMAPFILEHEADER fwrite(&bf, sizeof(BITMAPFILEHEADER), 1, outptr); // write outfile's BITMAPINFOHEADER fwrite(&bi, ...
1
vote
1answer
2k views

resize cs50. I am updating headers correctly?

I am struggling with this program. I cannot even check the headers with peek (I am receiving the message "could not recognize sample.bmp"). I am sure my program has several issues, but I would like to ...
1
vote
2answers
3k views

How to interpret biHeight data

I am having trouble with biHeight from the header info of bmp files. In the file small.bmp, from pset5, that is 3X3 pixels: biHeight has the value fffffffd. I would expect it to be the same as the ...
0
votes
3answers
755 views

Problem with cs50.h header file!

In pset1 for the mario program,when I compile my code including cs50.h header file in my code it throws up the following error However,when I don't include the cs50.h file and use scanf function ...
2
votes
0answers
27 views

What is the point of the linker? Isn't its job already done by the preprocessor, when using the #include statements? [duplicate]

If the preprocessor takes the header files in the #include statements, such as #include , and puts them into the source code, why does the linker have to link it? Isn't the code for that header file ...
0
votes
0answers
78 views

Header files in helpers pset3

What is the rationale for the header files in helpers.c? For example there is cs50.h but not stdio.h even though the functions are all stdio except for bool which is in neither CS50 nor helpers. And ...
0
votes
1answer
96 views

pset7 two headers

In pset7, I have two templates per controller (quote.php, buy.php, sell.php). The first controller is for the form (POST) and the second is for display (GET). When invalid data is entered, ex. invalid ...
0
votes
1answer
180 views

How do I view the source code of the functions in the cs50 library?

I wanna view the coding of the function GetFloat(). Okay. I know how to ask for a float using scanf and all, but i want to know how they coded the GetFloat so that it automatically rejects blank ...
3
votes
2answers
42k views

How do I share a variable between source files in C with extern?

I know that global variables in C sometimes have the extern keyword. What is an extern variable? What is the declaration like? What is its scope? This is related to sharing variables across source ...