Skip to main content

Questions tagged [headers]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
9 views

No such file or directory #include <cs50.h>

sorry to bother"unknown type name "string"], but I was trying again to follow the video instructions, and error again: "unknown type name "string", and another error: No ...
Alex Miami's user avatar
0 votes
1 answer
81 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 ...
EvilNeedsNoArms's user avatar
0 votes
1 answer
94 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(&...
Ha Tran's user avatar
  • 74
0 votes
1 answer
394 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>?
Nitish Panda's user avatar
0 votes
1 answer
141 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 ...
Jason_V's user avatar
  • 182
0 votes
1 answer
312 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 ...
alphaBytes's user avatar
0 votes
1 answer
49 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 ...
user14428's user avatar
0 votes
2 answers
142 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; ...
Himanshu Jhamb's user avatar
2 votes
1 answer
194 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 ...
ABor's user avatar
  • 55
0 votes
1 answer
181 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 ...
Norcim133's user avatar
2 votes
1 answer
337 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 ...
CharlesD89's user avatar
0 votes
0 answers
706 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 ...
GCOTT94's user avatar
1 vote
1 answer
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 ...
mathmagician's user avatar
2 votes
1 answer
574 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, ...
SwiftSilent's user avatar
1 vote
1 answer
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 ...
abc2015's user avatar
  • 15
1 vote
2 answers
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 ...
Touten's user avatar
  • 23
0 votes
3 answers
964 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 ...
Subhaprada Chand's user avatar
2 votes
0 answers
36 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 ...
inv3rsion's user avatar
0 votes
0 answers
81 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 ...
William Kenney's user avatar
0 votes
1 answer
97 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 ...
hunter's user avatar
  • 31
0 votes
1 answer
189 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 ...
Amrita's user avatar
  • 50
3 votes
2 answers
55k 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 ...
KlausCode's user avatar