on-internet
← Community

I narrowed a segfault to 22 lines of code, but I already accounted for null terminators in dynamic memory and variable limits. What else could it be?

Stack Overflow ·

Consider: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> // Linked List node struct node { // 'key' is a string char* key; // 'value' is also a string char* value; struct node* next; }; // like constructor void setNode(struct node* node, char* key, char* value) { node->key = key; node->value = value; node->next = NULL; return; }; struct hashMap { // Current number of elements in hashMap // and capacity of hashMap int numOfElements, capacity; // It holds the base address array of the linked list struct node** arr; }; // like constructor void initializeHashMap(stru

Comments

Sign in or sign up to comment and upvote.

No comments yet.