This commit is contained in:
benjamyn committed 2023-12-25 11:39:35 +12:00
1 parent 1ef0d29c9f
commit 4819b63b8d
17 files changed
+329 -29

No files matched your search

+7 -5
View File
@@ -16,20 +16,22 @@ int two_char_two_interger(int a, int b)
return num;
}
int is_num(char *test_string, char *num_to_match, int mem_length) {
int is_num(char *test_string, char *num_to_match, int mem_length)
{
char *input_copy = malloc(mem_length);
memcpy(input_copy, test_string, (size_t)mem_length);
if (strcmp(input_copy, num_to_match) == 0) {
return 0;
if (strcmp(input_copy, num_to_match) == 0)
{
return 0;
}
return 1;
}
int main()
{
const char *inputFile = "/home/ben/Documents/Projects/C/advent-of-code/day1/puzzle1/input";
const char *inputFile = "input";
int fd = open(inputFile, O_RDONLY);
if (fd < 0)