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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
#include <assert.h> | |
static pthread_t threads[2]; | |
static int IDs[2] = { 1, 2 }; | |
static int running; | |
static int waste_cycles(int n) |
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
#include <stdio.h> | |
typedef struct person { | |
char firstname[20]; | |
char lastname[20]; | |
unsigned int age; | |
} Person; | |
int main(void) | |
{ |
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
#include <stdio.h> | |
int main(void) | |
{ | |
char a[] = "Always writable"; | |
char *b = "Likely not writable"; | |
const char c[] = "Never writable"; | |
char *x = "xyz"; | |
char *y = "xyz"; |
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
#include <stdio.h> | |
int main(void) | |
{ | |
int a = 1; | |
int b = 2; | |
const int c = 3; | |
int *pa = &a; | |
const int *pb = &b; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include "queue.h" | |
static int *numbers; | |
Queue *generate(int n) | |
{ | |
Queue *input = queue_new(); |
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
#include <stdio.h> | |
#define A baz | |
int main(void) | |
{ | |
#if A == foo || A == bar | |
printf("Wrooong!\n"); | |
#endif | |
return 0; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <pthread.h> | |
#define refcount __attribute__((cleanup(release))) | |
#define REF_COUNT refcount_t _rc | |
typedef int refcount_t; |
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
a=foo.bar; echo ${a%%.*}_$RANDOM.${a#*.} |
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
y=1+2+3+4+5; lua -e "print(($y)/2)" |
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
./interpreter <(tr -s " " "\n" < $1) |