Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Segmentation Fault in C program

This is a discussion on Segmentation Fault in C program within the C and C++ forums, part of the Software Development category; When we do a C program what are the reasons for getting segmentation fault. In other words highlight the situation under which one might get segmentation fault while doing C ...

Go Back   Geeks Talk > Software Development > C and C++
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 06-29-2006
Expert Member
 
Join Date: May 2006
Location: New York, USA
Posts: 118
Thanks: 0
Thanked 6 Times in 4 Posts
RyanJames is on a distinguished road
Segmentation Fault in C program

When we do a C program what are the reasons for getting segmentation fault. In other words highlight the situation under which one might get segmentation fault while doing C program
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-26-2008
Junior Member
 
Join Date: Jan 2008
Location: KOLKATA
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
babai_ghosh007 is on a distinguished road
Re: Segmentation Fault in C program

when one fails to use the same number of closing braces as that of the opening braces.
Reply With Quote
  #3 (permalink)  
Old 01-26-2008
Junior Member
 
Join Date: Jan 2008
Location: KOLKATA
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
babai_ghosh007 is on a distinguished road
Re: Segmentation Fault in C program

when one fails to use the same number of closing braces as thet of the opening braces one may get segmentation problem.
Reply With Quote
  #4 (permalink)  
Old 01-28-2008
Expert Member
 
Join Date: Jan 2008
Location: Somewhere in the World..
Posts: 130
Thanks: 2
Thanked 6 Times in 6 Posts
jana05 is on a distinguished road
Re: Segmentation Fault in C program

When the rules to programming haven't been adhered, there are segmentation problems occurring. However, the compiler may pass successfully through the code, since there will not be any compilation errors....E.g: trying to print an integer as a string should generate a seg fault.
I don't think I understood ghosh answer. Not using same number of closing braces should actually lead you to a compilation error.
Reply With Quote
Reply

  Geeks Talk > Software Development > C and C++

Thread Tools
Display Modes

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 Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Achieve Scalability in Program RyanJames C and C++ 3 12-15-2006 02:08 PM


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


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved