Exforsys

Online Training

Kindly mention the Cases

This is a discussion on Kindly mention the Cases within the C and C++ forums, part of the Programming Talk category; What are the conditions or scenarios under which one may get Segmentation fault in C programming language? If someone could ...


Go Back   Exforsys > Programming Talk > C and C++

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-01-2007, 11:09 AM
Senior Member
 
Join Date: Apr 2006
Posts: 153
cyrus is on a distinguished road
Kindly mention the Cases

What are the conditions or scenarios under which one may get Segmentation fault in C programming language? If someone could mention this I will take care while coding my C program.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-02-2008, 04:58 PM
Member
 
Join Date: Apr 2006
Posts: 65
priyaraji is on a distinguished road
Segmentation fault in occurs mainly when a memory area that is not allowed to be accessed is tried to be used.

For example if you have a C code as below placed in a memory protected platform:

char *a = "Example";
*a = 'T';


Then on compilation of the above program you would get segmentation fault as the Example string was tried to be placed in area of memory marked as read only.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Kindly provide guidelines Adrian Siebel 1 04-11-2007 04:26 AM
Kindly mention the Languages cyrus C Sharp 0 02-26-2007 04:26 PM
Kindly Provide Answer for this Question Ralph SQL Server 0 12-15-2006 02:22 PM
A Guide for Test Cases, Test Suites, Test Scripts, and Test Scenarios anandamalan Software Testing 0 11-24-2006 04:54 AM
Test Cases In Automated and Manual Testing rajk Testing Tutorials 2 07-26-2006 04:18 AM


All times are GMT -4. The time now is 08:13 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.