This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Portable Pixmap in C example. | |
// Compile with: gcc anymap.c -o anymap | |
// Tutorial: https://nicolashollmann.de/blog/writing-portable-anymap/ | |
#include <stdio.h> | |
#define WIDTH 300 | |
#define HEIGHT 200 | |
// Uncomment to write binary instead of ASCII |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Windows Bitmap in C example. | |
// Compile with: gcc bmp.c -o bmp | |
// Tutorial: https://nicolashollmann.de/blog/writing-bmp-files/ | |
#include <stdio.h> | |
#include <stdint.h> | |
#define WIDTH 300 | |
#define HEIGHT 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run dynamic code on Unix (x86) | |
// Compile with: gcc -o dynamicCodeUnix dynamicCodeUnix.c | |
// Tutorial: https://nicolashollmann.de/blog/run-dynamic-code-unix/ | |
#include <stdio.h> | |
#include <stdbool.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/mman.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run dynamic code on Windows (x86) | |
// Compile with: gcc -o dynamicCodeWin dynamicCodeWin.c | |
// Tutorial: https://nicolashollmann.de/blog/run-dynamic-code-windows/ | |
#include <stdio.h> | |
#include <stdbool.h> | |
#include <Windows.h> | |
/** | |
* Helper function to execute dynamic code. |