1 2 3
void splitpath(const char *path, char *directory, char *filename, char *extension) { ...
1 2 3 4
#include <windows.h> #include <tchar.h> #include <stdio.h> ...
C Traverse Directory
by emeka.micro.myopenid.com,
April 12, 2010 12:54,
2 refactorings
I would like to improve my ...
1 2 3 4
int contains(const char* word, const char* pattern) { int pCount = 0, pLength = strlen(pattern); char i; ...
C String Searching Algorithm
I wrote the following funct...
1 2 3 4
/* * ===================================================================================== * ...
C Using semaphores in C and f...
by jarodluebbert.myopenid.com,
March 24, 2010 07:28,
No refactoring, tagged with c, concurrency, ipc, semaphores
Just posting this to check ...
1 2 3 4
#include <stdio.h> #include <stdint.h> #include <stdlib.h> ...
C Simple SHA Hashing
Dear All, I'm a new C progr...
1 2 3 4
void freeArray(int **a, int m) { int i; for (i = 0; i < m; ++i) { ...
C Freeing memory of a Multidi...
Is this the correct way to ...
1 2 3 4
/* * 0x378 - 0x37F are data pins * 0x383 - 0x387 are status pins ...
C LPT garland
This is my first C program....
1 2 3 4
/* a[1..k] - previous values ** c[1..k+1] - coefficients ** ...
C linear recurrence computation
For Jon Bentley's "Programm...
1 2 3 4
int Version_compare(Version *a, Version *b) { return a->major > b->major ? 1 : ...
C Version comparison
by Tj Holowaychuk,
October 14, 2009 22:01,
5 refactorings
More to the implementation ...
1 2 3 4
char * Method_to_s(Method *self) { static char buf[1024]; ...
C string buffer
What is the least inexpensi...
1 2 3 4
#include <stdio.h> #include <stdlib.h> ...
C program i wrote to learn
it works but i think i coul...
1 2 3 4
#include <stdio.h> #include <ctype.h> #include <string.h> ...
C FLAMES!!!!!!!!!!!!!!!!!
a little game which give yo...
1 2 3 4
void foo(char** array) { *array = (char *)calloc(2, sizeof(char*)); ...
C Initialize char array in fu...
How do you initialize an ar...
1 2 3 4
char * str_replace(char *str, char *old, char *new) { int i, count = 0; ...
C str_replace
Pretty weak first pass at a...
1 2 3 4
char str[] = "foo bar"; char delims[] = " "; char *word = strtok(str, delims); ...
C strtok WTF
I thought str[] and *str we...
1
str + strlen(str)
C Get last char
by Tj Holowaychuk,
May 12, 2009 20:00,
4 refactorings
super simple but seems like...
1 2
#define YA_SELECT(N) int yaElement_selector_##F (yaElement *self) #define YA_SELECT2(N, ARGS...) int yaElement_selector_##F (yaElement *self, ARGS)
C Macro variable arg substitu...
by Tj Holowaychuk,
May 13, 2009 17:00,
No refactoring
I would prefer YA_SELECT al...
I am new to C. Following co...