letters_to_fourcc.c 298 Bytes
Newer Older
Dafna Hirschfeld's avatar
Dafna Hirschfeld committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char* argv[]) {
	char a = argv[1][0];
	char b = argv[1][1];
	char c = argv[1][2];
	char d = argv[1][3];

	unsigned int f = ((uint)(a) | ((uint)(b) << 8) | ((uint)(c) << 16) | ((uint)(d) << 24));
	printf("%d (0x%x)\n", f, f);
	return 0;
}