Skip to main content
10 votes

How does “RGBTRIPLE triple;” know whitch pixel to store?

You have mixed them a little in your head but we are here. :) Firstly, the line RGBTRIPLE triple; doesn't get a pixel, it just declares a variable, of type RGBTRIPLE with the name triple. It would ...
ChrisG's user avatar
  • 7,396
1 vote

pset4 - (Filter Less ) - Doubts with malloc()

You seem to be confused about malloc(). malloc allocates memory from heap. You can store anything inside this allotted memory location. Specifically it expects the following input: number of bytes of ...
C--'s user avatar
  • 306
1 vote

How does RGBTRIPLE differentiate between the 3 bytes it reads from input file and assign them to rgbt blue, green and red?

When a struct is stored in memory, the data for each struct element is stored in sequence. That means that when a struct's data is read, the data is simply read into each element in the same order ...
Cliff B's user avatar
  • 69k

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