2

hi can anyone tell me please what is segmented error , i have made a program in c on linux and when i am running it after compiling , after a few inputs it shows segmwntwd erroe. what is this??:?:

3
Contributors
3
Replies
4
Views
11 Years
Discussion Span
Last Post by rati
3

You mean segmentation fault? Accessing memory which is not suposed to access (you probably wonder wtf that means :)). It would be best to post your code so we could help you. More information here

Votes + Comments
Salem spreading the rep
1

Segmentation error means runtime error which you get when you access the memory location which doesnt belong to you.
A typical case where this kind of error occurs is during array accessing which is known as buffer overflow.
Are there any array accesses in your code and if yes then check whether you are accessing the element which belongs to you.

For eg.

int my_array [4] = {1, 2, 3, 4} ;
// my_array [0] is the first element and my_array [3] is the last element.
my_array [4] = 20 ; // buffer overflow, runtime error

Hope it helped, bye.

0

hi can anyone tell me please what is segmented error , i have made a program in c on linux and when i am running it after compiling , after a few inputs it shows segmwntwd erroe. what is this??:?:

thanks for your help, i found the error. actually i was using wrong pointer mathematics which cause error, thanx once again:lol:

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.