Find jobs | Company-wise jobs
Jobseekers | Employer login
About us Sitemap of www.CareerRide.com Sitemap FAQ related with www.CareerRide.com FAQ Click here to Contact us Contact
       
Submit Resume Free ! | Access Resume Free !
Home Interview Q&A Tutorials Oracle Sql server .NET Java Soft skills CV GD Work from home Online practice test FAQs in PDF Books Jobs FAQs

Segmentation violation

<<Previous   Next>>

C - meaning of "Segmentation violation" - August 06, 2008 at 13:10 PM by Amit Satpute

Explain the meaning of "Segmentation violation". 

A segmentation violation usually indicates an attempt to access memory which doesn't even exist. 

C - meaning of "Segmentation violation" - Jan 11, 2010 at 12:15 PM by Vidya Sagar

Explain the meaning of "Segmentation violation".

Segmentation violation usually occurs at the time of a program’s attempt for accessing memory location, which is not allowed to access. The following code should create segmentation violation.

main() {
char *hello = “Hello World”;
*hello = ‘h’;
}

At the time of compiling the program, the string “hello world” is placed in the binary mark of the program which is read-only marked. When loading, the compiler places the string along with other constants in the read-only segment of the memory. While executing a variable *hello is set to point the character ‘h’ , is attempted to write the character ‘h’ into the memory, which cause the segmentation violation. And, compiler does not check for assigning read only locations at compile time.

<<Previous   Next>>
 

 

 
Want to be hunted by potential employers? Just submit your key skills!

Popular FAQs

.NET .Net Architecture ADO.NET Java Oracle C#.NET
VB.NET DOT.NET AJAX ASP.NET NET Framework OOPS in .NET
C++ Sql Server Data warehousing EJB MySQL Linux
PHP UML Networking Testing XML  
 
Copyright © 2008 - 2010 CareerRide.com. All rights reserved.