Skip to main content
2 votes
Accepted

PSet4, resize.c. Stuck on solution using malloc (recopy)

Your code is fixable with 3 adjustments. The biggest problem is that your "tracker variable" (t) for your buffer gets reset to 0 for every pixel of the infile, rather than for every line. In other ...
Omid's user avatar
  • 36
1 vote

CS50 pset4 recover: buffer type and fseek questions

an int is 4 bytes an unsigned char is 1 byte so buffer[3] in char is the 4th byte but in int it is the 13-16 bytes. so when using int you are not actually checking the first 4 bytes, but the first 16.
masterseeker's user avatar
1 vote
Accepted

Data Type to be used in Buffer for Recover (PSET4)

You're trying to put strings into byte/unsigned char/char arrays. Quotation marks denote a string. Since the values you're trying to put in are in fact, numbers, you must not use quotation marks. ...
aquablitz11's user avatar
1 vote
Accepted

pset4 malloc() approach. Help with size of buffer

It has nothing to do with the malloc call itself. The problem lies in what you think you are checking. Look at the following: RGBTRIPLE* row = ... int sizeRow = sizeof(row); row is declared as a ...
Cliff B's user avatar
  • 69.1k

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