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??:?:

Recommended Answers

All 3 Replies

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

commented: Salem spreading the rep +2

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.

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:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.