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
2 RĂ©ponses
+ 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.
- 3
No idea!