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> | |
long hexToInt(char hexString[]) { | |
long result = 0; | |
for (int i = 0; hexString[i] != '\0'; i++) { | |
if ((hexString[i] == '0' && hexString[i + 1] == 'x') || hexString[i] == 'x') { | |
continue; | |
} |
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> | |
// remove all characters in string[] that occur in remove[] | |
void squeeze(char string[], char remove[]) { | |
int i, x; | |
for (i = x = 0; string[i] != '\0'; i++) { | |
int removeChar = 0; | |
for (int j = 0; remove[j] != '\0'; j++) { |
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> | |
// return the index of the first occurrence of any character in matching occuring in string. -1 if none. | |
int any(char string[], char matching[]) { | |
for (int i = 0; string[i] != '\0'; i++) { | |
for (int j = 0; matching[j] != '\0'; j++) { | |
if (string[i] == matching[j]) { | |
return i; | |
} | |
} |
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> | |
int main() { | |
int c; | |
char line[] = ""; | |
for (int i = 0; (c = getchar()) != EOF; i++) { | |
line[i] = c; | |
if (c == '\n') { |
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> | |
#define MAX_LINE_LENGTH 100 | |
enum PositionState { | |
POSITION_STATE_WHOLE, | |
POSITION_STATE_DECIMAL, | |
POSITION_STATE_NOTATION | |
}; |
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> | |
int main() { | |
int test[100]; | |
int *testP = test; | |
while (1) { | |
printf("%c, %p\n", testP); | |
//*testP = 0; // This will segfault, however reading does not?.. | |
testP++; |
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> | |
int mystrend(char *s, char *c) { | |
int sLen = 0; | |
int cLen = 0; | |
while (*s != '\0') { | |
s++, sLen++; | |
} |
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 <memory.h> | |
#include <dirent.h> | |
#include <dictionary_c.h> | |
#define DICT_MAX_SIZE_BYTES 1024 * 1024 * 32 | |
#define DICT_MIN_PATTERN_SIZE_BYTES 2 | |
#define DICT_STOP_SYMBOL '\0' | |
#define DICT_MAX_AUTOMATON_SIZE_BYTES 2 << 30 |
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
function VehicleConstructor(name) { | |
var vehicle = {}; | |
//Properties | |
vehicle.name = name; | |
vehicle.milesTravelled = 0; | |
vehicle.maxPassengers = 0; | |
vehicle.currentPassengers = 0; | |
// Default Assignments |
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
/* | |
Preface: | |
I'm issuing this challenge as I've hit a major roadblock in the development process | |
of one of my personal side projects. I've spent the last 2 weeks exhaustively exploring | |
solutions to the following problem and I'm at my wits end. I've taken a number of approaches | |
using various tree data structures and clever algorithms with no success. | |
OlderNewer