Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char extra[width % 4];
- for (int i = 0; i < width % 4; i++)
- {
- extra[i] = 0;
- }
- size_t extra_bytes = (width % 4) * sizeof(char);
- for (int i = 0; i < height; i++)
- {
- fwrite(pixels[i], sizeof(pixel_t) * width, 1, file);
- fwrite(extra, extra_bytes, 1, file);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement