This file contains hidden or 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
#include <assert.h> | |
#include <limits.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <Windows.h> | |
#define _tmain main | |
#define TCHAR char |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int fswap(FILE *file, off64_t x, off64_t y, size_t size) { | |
unsigned char i[size], o[size]; | |
return fseeko64(file, x * size, SEEK_SET) || fread(i, size, 1, file) != 1 || | |
fseeko64(file, y * size, SEEK_SET) || fread(o, size, 1, file) != 1 || | |
fseeko64(file, y * size, SEEK_SET) || fwrite(i, size, 1, file) != 1 || |
This file contains hidden or 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
#include "living_being.h" | |
struct living_being { | |
int meaning; | |
}; | |
#include <stdlib.h> | |
void give_birth(living_being **toilet) { | |
*toilet = malloc(sizeof **toilet); |
This file contains hidden or 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
/* gcc -std=c11 get_network_params.c -lws2_32 -liphlpapi -o get_network_params.exe */ | |
#include <winsock2.h> | |
#include <iphlpapi.h> | |
#include <stdio.h> | |
int main(void) { | |
FIXED_INFO *fixed_info = (FIXED_INFO[]) { 0 }; | |
ULONG fixed_info_size = 0; | |
GetNetworkParams(fixed_info, &fixed_info_size); |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int finsert(FILE *file, fpos_t position, void *object, size_t size) { | |
unsigned char i[size], o[size]; | |
memcpy(o, object, size); | |
if (fsetpos(file, &position)) { | |
return -1; |
This file contains hidden or 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
// To compile: cc -c -std=c99 linked_list.c | |
// cc -std=c99 automatic_test.c linked_list.o -o automatic_test | |
#include <stdio.h> | |
#include <string.h> | |
#include "linked_list.h" | |
struct apple_linked_list { | |
struct automatic_linked_list_node linked_list; |
This file contains hidden or 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
/* (c) 2015 Sebastian Ramadan * | |
* May you perish in court if this makes its way into turnitin software, * | |
* ... for it is my intellectual property ;) * | |
*/ | |
#include <stdint.h> | |
#include <stdio.h> | |
int main(int argc, char **argv) { | |
uintmax_t y; |
This file contains hidden or 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
int main(void) { | |
unsigned char *value = NULL; | |
size_t size = 0; | |
for (;;) { | |
int c = getchar(); | |
if (c == EOF) { | |
break; | |
} |
This file contains hidden or 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
#include <assert.h> | |
#include <stdio.h> | |
int main(void) { | |
unsigned int criteria[2] = { 0 }; | |
#ifndef UNBUFFERED | |
int n = setvbuf(stdin, NULL, _IOFBF, 65536); | |
assert(n == 0); |
This file contains hidden or 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
int main(void) { | |
int lower_length = 0, | |
upper_length = 0, | |
digit_length = 0, | |
length = 0; | |
puts("Please enter a password and I'll judge its security..."); | |
# define LOWER_FMT "%*[qwertyuiopasdfghjklzxcvbnm]%n" |
NewerOlder