cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Segmentation Error
Segmentation Error
Sep 8, 2012 at 9:29pm UTC
badkaykay
(96)
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.
Sep 8, 2012 at 9:39pm UTC
Athar
(4466)
This happens when you're trying to access memory that you shouldn't be accessing.
Sep 8, 2012 at 9:49pm UTC
badkaykay
(96)
Oh - how do I fix it? Suggestions?
Sep 8, 2012 at 9:58pm UTC
Aceix
(1118)
Then show us your code please...
Sep 8, 2012 at 11:20pm UTC
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
Sep 8, 2012 at 11:20pm UTC
Topic archived. No new replies allowed.