Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
why is it showing segmentation fault at the end of the compilation?
0
votes
asked
Jun 24, 2019
by
GOPALGANGULY
(
120
points)
https://onlinegdb.com/B1ldz80JH
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
2 Answers
+1
vote
answered
Jun 24, 2019
by
anonymous
because you are trying to access the memory which you have not allocated
ex. your array size is 10 (a[10]) and you are trying to access the memory at 11th index (a[11])
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
answered
Aug 20, 2019
by
SWEngineer
(
300
points)
What you have in your code is called "infinite recursion". It results in a Stack Overflow rather quickly.
See this corrected code:
https://onlinegdb.com/SJh5u8KNS
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...