Implementing a Hashmap in C - Void Pointers

preview_player
Показать описание
Implementing a Hashmap in C - Void Pointers

Рекомендации по теме
Комментарии
Автор

You're insane, keep it up mate, this is legit content. MAKE MORE! PLZ

theuniverse
Автор

such amazing content every day, please take a rest so that you don’t quit

ryuen-vnem
Автор

New sub. Just started learning C a few months ago. What editor do you use?

liquidmobius
Автор

This is UB:
```
current->key = malloc(sizeof(char) * strlen(key));
strcpy(current->key, key);

```
You need to reserve memory for the null terminator (also sizeof(char) is always 1 so you don't need to multiply by it):
```
current->key = malloc(strlen(key) + 1);
strcpy(current->key, key);
```

stomah
join shbcf.ru