Segmentation Error

I am getting this as an error message:

Please enter file name:
file.txt
File is open.
Number of Vowel: 30
Number of Consonants: 1003
Segmentation Fault (core dumped)


What does this mean? I have not seen it before.
This happens when you're trying to access memory that you shouldn't be accessing.
Oh - how do I fix it? Suggestions?
Then show us your code please...
closed account (zb0S216C)
airpan wrote:
"Oh - how do I fix it? Suggestions?"

Use a standard container, check for null before dereferencing, don't return references or pointers to local storage, and check the index to see if it's within range (if you're using arrays).

Wazzak
Last edited on
Topic archived. No new replies allowed.