segmentation fault 11 (c++) | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

segmentation fault 11 (c++)

i know it will be hard to answer since i donā€™t have my code (did it on computer, donā€™t know how to upload to this) but i am trying to add words from a text file into my hash table but i keep getting a segmentation fault 11. iā€™m using fstream and they are all strings from the file, and my addItem function takes a string so i donā€™t know why itā€™s getting a segmentation fault. when i use my addItem function to insert and different random string (not from the file) it works fine. if there is a way to upload my code from VSC then let me know and i will do that. thank you

7th Nov 2020, 9:14 PM
menstro
2 Respostas
+ 3
Segmentation faults happen when you access memory that you don't own. Like maybe you are reading past an array's end or using a pointer after freeing, etc etc. It can be anything. Sololearn has a code playground where you could upload your code to.
7th Nov 2020, 10:55 PM
Schindlabua
Schindlabua - avatar
- 3
No idea!
7th Nov 2020, 10:12 PM
Muhammad Atif Waheed
Muhammad Atif Waheed - avatar