Thread: Need help to get rid of segmentation fault

  1. #1
    Registered User
    Join Date
    Jun 2012
    Posts
    7

    Need help to get rid of segmentation fault

    Hi everyone in the forum. I was just wondering if anyone in this forum could help me get rid of segmentation fault in my programme. The code of the programme is below"

    Code:
    #include <iostream>
    #include <fstream>
    #include <string>
    #include <vector>
    using namespace std;
    
    
    //Define a class to represent each Seismic Activity measurement event...
    
    
    class RedwoodBaySeismicData  {
      string LocationID;  	//This is the station that owns this piece of data…
      string Date;  		 //The date that the values were collected…
      string Time;  		//The time of day that the values were collected…
      double SeismicSize; 	//Magnitude of Earthquake
      
    
    
    public:
      RedwoodBaySeismicData();
      RedwoodBaySeismicData(string, string, string, double);
    
    
      //The first group of member functions are used to change values...
      //Functions are defined in the form of inlines.
    
    
      void SetID(string ID)					{ LocationID = ID; }
      void SetDate(string Day)			{ Date = Day; }
      void SetTime(string Hour)			{ Time = Hour; }
      void SetSeismicSize(double Magnitude)	{SeismicSize = Magnitude; }
      
    
    
      //The second group allows controlled access to individual value in the class...
    
    
      string GetID()				{ return LocationID; }
      string GetDate()			{return Date; }
      string GetTime()			{return Time; }
      double GetSeismicSize()	{ return SeismicSize;}  
      
    
    
    };
    
    
    //The default constructor sets the private variable members to a harmless value...
    
    
    RedwoodBaySeismicData::RedwoodBaySeismicData()
    {
    	LocationID = "";
    	Date = "";
    	Time = "";
    	SeismicSize = 0.0;
    	
    }
    
    
    //This initializing  constructor allows you to create a object with value already set...
    
    
     RedwoodBaySeismicData::RedwoodBaySeismicData(string ID, string Day, string Hour, double Magnitude)
    {
    	LocationID = ID;
    	Date = Day;
    	Time = Hour;
    	SeismicSize = Magnitude;
    	
    }
     
     class RedwoodBayDataList  {
    	vector<RedwoodBaySeismicData> RedwoodBayDataSpots;  //Create a collection of location information...
        string FileName ;
    public:
    	RedwoodBayDataList()  {FileName = "RedwoodBaySeismicEventList.Data";}
    
    
        
        void PostSeismicInfo();
        void WeeklyReport();
    };
    
    
    
    
    
    
    
    
    //Allow the user to post the values for each location...
    
    
    void RedwoodBayDataList::PostSeismicInfo()
    {
    	int K;
    	string Line, ID, Date, Hour;
    	double Magnitude;
        fstream InFile("RedwoodBaySeismicEventList.data", ios::in);
    	//...then get the values for each location...
    	RedwoodBaySeismicData Buffer;
    
    
    
    
    	for(K = 0 ; K < 42 ; K++)  {
              
            getline(InFile, Line);
    		ID = Line.substr(0,4);
    		Date =  Line.substr(6,7);
    		Hour = Line.substr(9,3);
    		Magnitude = atof(strtok((char*)Line.c_str(), " ") );
    		 
    		
            
            Buffer.SetID(ID);    //Use these values to load the Buffer record...
    		Buffer.SetDate(Date);	
    		Buffer.SetTime(Hour);
         	Buffer.SetSeismicSize(Magnitude);
            RedwoodBayDataSpots.push_back(Buffer);
    
    
    		RedwoodBayDataSpots[K].SetID(ID);
    		RedwoodBayDataSpots[K].SetDate(Date);
    		RedwoodBayDataSpots[K].SetTime(Hour);
    		RedwoodBayDataSpots[K].SetSeismicSize(Magnitude);
    
    
    	cin.ignore(100,'\n');  //This flushes the input buffer of any extra characters.
    
    
    }
    
    
    }
    //This produces the final product...the report on Seismic Activiies.....
    
    
    void RedwoodBayDataList::WeeklyReport()
    {
    	int Count;
    
    
        cout << "\n\t=============================================================" << endl;  //This section is the report...it's really all about the formatting...
        cout << "\tWeekly Report" << endl;
        cout << "\t===============================================================" << endl;
    	cout << "\tLocation\tDate\tHour\tMagnitude" << endl;
        cout << "\t===============================================================" << endl;
    	for(Count = 0 ; Count < 42 ; Count++) 
    		cout << "\t" << RedwoodBayDataSpots[Count].GetID() << "\t" << RedwoodBayDataSpots[Count].GetDate() << "\t" << RedwoodBayDataSpots[Count].GetTime() << "\t"  << RedwoodBayDataSpots[Count].GetSeismicSize();
            cout << "\t===============================================================\n\n" << endl;
    }
    
    
    //Declare the functions...
    
    
    void RunIT();
    void Menu();
    
    
    
    
    int main()
    {
    	RunIT();
    }
    
    
    //This function implements a simple command processor...
    
    
    void RunIT()
    {
    	RedwoodBayDataList RedwoodBayDataSpots;
    	string Command = "";
    
    
    	while(Command != "Quit")  {
    		Menu();
    		cout << "Command: ";
            getline(cin, Command);
    
    
    		
    	    if(Command == "Report")
    			RedwoodBayDataSpots.WeeklyReport();
    	}
    }
    
    
    //This function tells the user what he or she can do...
    
    
    void Menu()
    {
    	cout << "Choices...................................................." << endl;
    	cout << "-----------------------------------------------------------" << endl;
    	cout << "\tReport...displays the  report." << endl;
    	cout << "\tQuit.....exits the program." << endl;
    	cout << "-----------------------------------------------------------" << endl;
    }
    Any help or suggestions will be greatly appreciated.

  2. #2
    Registered User
    Join Date
    Aug 2006
    Posts
    163
    Have you tried debugging at all? From here it looks like when you run your program and ask for a Report, you attempt to access an index of RedwoodBayDataSpots before ever filling it.

  3. #3
    Registered User antred's Avatar
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    257
    This line is pure evil:

    Code:
    Magnitude = atof(strtok((char*)Line.c_str(), " ") );
    c_str() return a CONST char*. That means you MUST NOT modify the data that the pointer returned by c_str() points to, and yet that's exactly what you do by casting its constness away and then passing it to strtok(). Don't!

    P.S. Worst case scenario: strtok() writes past the memory the string object has allocated for its internal string representation, thereby corrupting its internal state, which (surprise surprise) may lead to all kinds of fun (such as segmentation faults, for instance) later on.


    2nd P.S. Okay, I just checked what strtok() actually does, and the scenario I descibed (array bounds violation) is an unlikely consequence, but it's still wrong all the same.
    Last edited by antred; 06-13-2012 at 12:07 PM.

  4. #4
    Registered User antred's Avatar
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    257
    Quote Originally Posted by System_159 View Post
    Have you tried debugging at all? From here it looks like when you run your program and ask for a Report, you attempt to access an index of RedwoodBayDataSpots before ever filling it.
    To add to System_159's post, since you're already using vectors and string objects, consider using their at()-methods instead of [] to access individual elements by index. at() will raise an exception if it detects an out-of-bounds access whereas operator [] will just silently ignore the problem.

  5. #5
    Registered User
    Join Date
    Jun 2012
    Posts
    7
    Quote Originally Posted by antred View Post
    This line is pure evil:

    Code:
    Magnitude = atof(strtok((char*)Line.c_str(), " ") );
    c_str() return a CONST char*. That means you MUST NOT modify the data that the pointer returned by c_str() points to, and yet that's exactly what you do by casting its constness away and then passing it to strtok(). Don't!

    P.S. Worst case scenario: strtok() writes past the memory the string object has allocated for its internal string representation, thereby corrupting its internal state, which (surprise surprise) may lead to all kinds of fun (such as segmentation faults, for instance) later on.


    2nd P.S. Okay, I just checked what strtok() actually does, and the scenario I descibed (array bounds violation) is an unlikely consequence, but it's still wrong all the same.
    Hi Antred. Thanks for your response. The thing is that since "Magnitude" is a double variable, I can not read it from the file by using "substr" like I did for other variables. Do you happen to know any other way (without using "strtok") to read the "Magnitude" from the file in this case?
    Last edited by torresdrogba; 06-13-2012 at 12:37 PM.

  6. #6
    Registered User antred's Avatar
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    257
    You could hack up a little utility function:

    Code:
    #include <sstream>
    
    template < typename TargetType >
    TargetType fromString( const std::string& theString )
    {
        std::istringstream myStream( theString );
        TargetType t = TargetType();
        myStream >> t;
        return t;
    }
    And then use it to extract your double:

    Code:
    Magnitude = fromString< double >( Line );

  7. #7
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by antred
    You could hack up a little utility function
    Or if Boost is available, you could use boost::lexical_cast, which is more comprehensive and does additional error checking.

    By the way, I don't see the point of writing:
    Code:
    TargetType t = TargetType();
    since it would be simpler to write:
    Code:
    TargetType t;
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  8. #8
    Registered User antred's Avatar
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    257
    Quote Originally Posted by laserlight View Post
    By the way, I don't see the point of writing:
    Code:
    TargetType t = TargetType();
    since it would be simpler to write:
    Code:
    TargetType t;
    Did that just to enforce default initialization for built-in types.

  9. #9
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    Then you're relying on the myStream >> t; line to not modify t if the data in the string cant be converted to that type right?

    It might be a bug but when I tried to do that with an unsigned int in gcc it changed the value of the variable even when the string clearly was not convertible to unsigned int. The assumption seemed to hold for other types though.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  10. #10
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by antred
    Did that just to enforce default initialization for built-in types.
    I believe that is technically value initialisation, but anyway boost::lexical_cast just throws an exception. In my opinion, this is better than following atoi's approach since you cannot differentiate between say, 0 being a valid result of a conversion to int and 0 being the result of a failed conversion.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  11. #11
    Registered User
    Join Date
    Jun 2012
    Posts
    7
    First, thanks everyone for their sound and erudite advices. But, I would just like to point out that I am not in anyway advanced programmer. As a matter of fact I just started learning C++ about two months ago. So, some of the advices that I got from people here were beyond my ability to understand. Anyway, I did a research for a day about all those topics and options you guys brought here in this thread. However, it seems like it is going take more than a day for sure to be familiar with all those advanced materials. Anyway, in the meantime I came up with a simple solution for my problem. As many of you point it out that the use of c_str() might be contributing for the rise of segmentation fault, i decided not to use it anymore. So, now I am reading the double variable "Magnitude" with the help of stringstream. However, contrary to what I expected, the programme is still suffering from segmentation fault.
    Here is the modified code for the programme:

    Code:
    #include <iostream>
    #include <fstream>
    #include <string>
    #include <vector>
    #include <sstream>
    using namespace std;
    
    //Define a class to represent each Seismic Activity measurement event...
    
    class RedwoodBaySeismicData  {
      string LocationID;   //This is the station that owns this piece of data…
      string Date;     //The date that the values were collected…
      string Time;    //The time of day that the values were collected…
      double SeismicSize;  //Magnitude of Earthquake
      
    
    public:
      RedwoodBaySeismicData();
      RedwoodBaySeismicData(string, string, string, double);
    
      //The first group of member functions are used to change values...
      //Functions are defined in the form of inlines.
    
      void SetID(string ID)     { LocationID = ID; }
      void SetDate(string Day)   { Date = Day; }
      void SetTime(string Hour)   { Time = Hour; }
      void SetSeismicSize(double Magnitude) {SeismicSize = Magnitude; }
      
    
      //The second group allows controlled access to individual value in the class...
    
      string GetID()    { return LocationID; }
      string GetDate()   {return Date; }
      string GetTime()   {return Time; }
      double GetSeismicSize() { return SeismicSize;}  
      
    
    };
    
    //The default constructor sets the private variable members to a harmless value...
    
    RedwoodBaySeismicData::RedwoodBaySeismicData()
    {
     LocationID = "";
     Date = "";
     Time = "";
     SeismicSize = 0.0;
     
    }
    
    //This initializing  constructor allows you to create a object with value already set...
    
     RedwoodBaySeismicData::RedwoodBaySeismicData(string ID, string Day, string Hour, double Magnitude)
    {
     LocationID = ID;
     Date = Day;
     Time = Hour;
     SeismicSize = Magnitude;
     
    }
     
     class RedwoodBayDataList  {
     vector<RedwoodBaySeismicData> RedwoodBayDataSpots;  //Create a collection of location information...
        string FileName ;
    public:
     RedwoodBayDataList()  {FileName = "RedwoodBaySeismicEventList.Data";}
    
        
        void PostSeismicInfo();
        void WeeklyReport();
    };
     
     
     
    
    //Allow the user to post the values for each location...
    
    void RedwoodBayDataList::PostSeismicInfo()
    {
     int K;
     string Line, ID, Date, Hour;
     double Magnitude;
        fstream InFile("RedwoodBaySeismicEventList.data", ios::in);
     //...then get the values for each location...
     RedwoodBaySeismicData Buffer;
     
    
     for(K = 0 ; K < 42 ; K++)  {
              
            getline(InFile, Line);
      ID = Line.substr(0,4);
      Date =  Line.substr(6,7);
      Hour = Line.substr(9,3);
      istringstream buf(Line.substr(5,2));
            buf>> Magnitude;
       
      
            
            Buffer.SetID(ID);    //Use these values to load the Buffer record...
      Buffer.SetDate(Date); 
      Buffer.SetTime(Hour);
          Buffer.SetSeismicSize(Magnitude);
            RedwoodBayDataSpots.push_back(Buffer);
    
      RedwoodBayDataSpots[K].SetID(ID);
      RedwoodBayDataSpots[K].SetDate(Date);
      RedwoodBayDataSpots[K].SetTime(Hour);
      RedwoodBayDataSpots[K].SetSeismicSize(Magnitude);
    
     cin.ignore(100,'\n');  //This flushes the input buffer of any extra characters.
    
    }
    
    }
    //This produces the final product...the report on Seismic Activiies.....
    
    void RedwoodBayDataList::WeeklyReport()
    {
     int Count;
    
        cout << "\n\t=============================================================" << endl;  //This section is the report...it's really all about the formatting...
        cout << "\tWeekly Report" << endl;
        cout << "\t===============================================================" << endl;
     cout << "\tLocation\tDate\tHour\tMagnitude" << endl;
        cout << "\t===============================================================" << endl;
     for(Count = 0 ; Count < 42 ; Count++) 
      cout << "\t" << RedwoodBayDataSpots[Count].GetID() << "\t" << RedwoodBayDataSpots[Count].GetDate() << "\t" << RedwoodBayDataSpots[Count].GetTime() << "\t"  << RedwoodBayDataSpots[Count].GetSeismicSize();
            cout << "\t===============================================================\n\n" << endl;
    }
    
    //Declare the functions...
    
    void RunIT();
    void Menu();
     
    
    int main()
    {
     RunIT();
    }
    
    //This function implements a simple command processor...
    
    void RunIT()
    {
     RedwoodBayDataList RedwoodBayDataSpots;
     string Command = "";
    
     while(Command != "Quit")  {
      Menu();
      cout << "Command: ";
            getline(cin, Command);
    
      
         if(Command == "Report")
       RedwoodBayDataSpots.WeeklyReport();
     }
    }
    
    //This function tells the user what he or she can do...
    
    void Menu()
    {
     cout << "Choices...................................................." << endl;
     cout << "-----------------------------------------------------------" << endl;
     cout << "\tReport...displays the  report." << endl;
     cout << "\tQuit.....exits the program." << endl;
     cout << "-----------------------------------------------------------" << endl;
    }

  12. #12
    Registered User
    Join Date
    May 2010
    Posts
    4,633
    In your void RedwoodBayDataList::WeeklyReport() function you are trying to access elements of your vector before you add any elements to this vector. In the following snippet:
    Code:
    void RedwoodBayDataList::WeeklyReport()
    {
     int Count;
    ....
     for(Count = 0 ; Count < 42 ; Count++)
      cout << "\t" << RedwoodBayDataSpots[Count].GetID() << "\t" << RedwoodBayDataSpots[Count].GetDate() << "\t" << RedwoodBayDataSpots[Count].GetTime() << "\t"  << RedwoodBayDataSpots[Count].GetSeismicSize();
    There are no elements in your RedwoodBayDataSpots vector, it looks like you need to read your file and add items to the vector so you can print your report.

    Jim

  13. #13
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Your indentation is also all over the place. You should be consistent in indenting your code.

    What you should be doing in WeeklyReport is using the size of the vector as your bounds for iterating over it (or using an iterator). Here's an example of the first:

    Code:
    void RedwoodBayDataList::WeeklyReport()
    {
        cout << "\n\t=============================================================" << endl;  //This section is the report...it's really all about the formatting...
        cout << "\tWeekly Report" << endl;
        cout << "\t===============================================================" << endl;
        cout << "\tLocation\tDate\tHour\tMagnitude" << endl;
        cout << "\t===============================================================" << endl;
        for(size_t Count = 0; Count < RedwoodBayDataSpots.size() ; ++Count)
           cout << "\t" << RedwoodBayDataSpots[Count].GetID() << "\t" << RedwoodBayDataSpots[Count].GetDate() << "\t" << RedwoodBayDataSpots[Count].GetTime() << "\t"  << RedwoodBayDataSpots[Count].GetSeismicSize();
        cout << "\t===============================================================\n\n" << endl;
    }
    Even better would be to overload the stream insertion operator ( << ) for the RedwoodBaySeismicData class, so that becomes as simple as:

    Code:
    void RedwoodBayDataList::WeeklyReport()
    {
        cout << "\n\t=============================================================" << endl;  //This section is the report...it's really all about the formatting...
        cout << "\tWeekly Report" << endl;
        cout << "\t===============================================================" << endl;
        cout << "\tLocation\tDate\tHour\tMagnitude" << endl;
        cout << "\t===============================================================" << endl;
        for(size_t Count = 0; Count < RedwoodBayDataSpots.size() ; ++Count)
           cout <<RedwoodBayDataSpots[Count];
        cout << "\t===============================================================\n\n" << endl;
    }
    Last edited by rags_to_riches; 06-16-2012 at 04:02 AM.

  14. #14
    Registered User
    Join Date
    Jun 2012
    Posts
    7
    Hi forum. I was busy doing other stuff, so I could not take part in the discussion yesterday. But, anyway, as per the advice of rags_to_riches and jimblumberg, I have made some modifications on my code. And, thanks to both as my programme does not suffer from segmentation fault anymore. However, the programme is still not being able to read the data from the file. Here is the modified code for the programme:

    Code:
    #include <iostream>
    #include <fstream>
    #include <string>
    #include <vector>
    #include <sstream>
    using namespace std;
    //Define a class to represent each Seismic Activity measurement event...
    class RedwoodBaySeismicData {
    string LocationID; //This is the station that owns this piece of data…
    string Date; //The date that the values were collected…
    string Time; //The time of day that the values were collected…
    double SeismicSize; //Magnitude of Earthquake
    
    public:
    RedwoodBaySeismicData();
    RedwoodBaySeismicData(string, string, string, double);
    //The first group of member functions are used to change values...
    //Functions are defined in the form of inlines.
    void SetID(string ID) { LocationID = ID; }
    void SetDate(string Day) { Date = Day; }
    void SetTime(string Hour) { Time = Hour; }
    void SetSeismicSize(double Magnitude) {SeismicSize = Magnitude; }
    
    //The second group allows controlled access to individual value in the class...
    string GetID() { return LocationID; }
    string GetDate() {return Date; }
    string GetTime() {return Time; }
    double GetSeismicSize() { return SeismicSize;} 
    
    
    };
    //The default constructor sets the private variable members to a harmless value...
    RedwoodBaySeismicData::RedwoodBaySeismicData()
    {
    LocationID = "";
    Date = "";
    Time = "";
    SeismicSize = 0.0;
    
    }
    //This initializing constructor allows you to create a object with value already set...
    RedwoodBaySeismicData::RedwoodBaySeismicData(string ID, string Day, string Hour, double Magnitude)
    {
    LocationID = ID;
    Date = Day;
    Time = Hour;
    SeismicSize = Magnitude;
    
    }
    
    class RedwoodBayDataList {
    vector<RedwoodBaySeismicData> RedwoodBayDataSpots; //Create a collection of location information...
    string FileName ;
    public:
    RedwoodBayDataList() {FileName = "RedwoodBaySeismicEventList.data";}
    
    void PostSeismicInfo();
    void WeeklyReport();
    };
    
    
    
    //Allow the user to post the values for each location...
    void RedwoodBayDataList::PostSeismicInfo()
    {
    int K;
    string Line, ID, Date, Hour;
    double Magnitude;
    fstream InFile("RedwoodBaySeismicEventList.data", ios::in);
    //...then get the values for each location...
    RedwoodBaySeismicData Buffer;
    
    cout << "\n\t=============================================================" << endl; //This section is the report...it's really all about the formatting...
    cout << "\tWeekly Report" << endl;
    cout << "\t===============================================================" << endl;
    cout << "\tLocation\tDate\tHour\tMagnitude" << endl;
    cout << "\t===============================================================" << endl;
    
    for(size_t K = 0; K < RedwoodBayDataSpots.size(); ++K) {
    
    getline(InFile, Line);
    ID = Line.substr(0,4);
    Date = Line.substr(6,7);
    Hour = Line.substr(9,3);
    istringstream buf(Line.substr(5,2));
    buf>> Magnitude;
    
    RedwoodBayDataSpots[K].SetID(ID);
    RedwoodBayDataSpots[K].SetDate(Date);
    RedwoodBayDataSpots[K].SetTime(Hour);
    RedwoodBayDataSpots[K].SetSeismicSize(Magnitude); 
    cout << "\t" << RedwoodBayDataSpots[K].GetID() << "\t" << RedwoodBayDataSpots[K].GetDate() << "\t" << RedwoodBayDataSpots[K].GetTime() << "\t" << RedwoodBayDataSpots[K].GetSeismicSize();
    }
    cout << "\t===============================================================\n\n" << endl;
    
    }
    
    
    
    //Declare the functions...
    void RunIT();
    void Menu();
    
    int main()
    {
    RunIT();
    }
    //This function implements a simple command processor...
    void RunIT()
    {
    RedwoodBayDataList RedwoodBayDataSpots;
    string Command = "";
    while(Command != "Quit") {
    Menu();
    cout << "Command: ";
    getline(cin, Command);
    
    if(Command == "Report")
    RedwoodBayDataSpots.PostSeismicInfo();
    }
    }
    //This function tells the user what he or she can do...
    void Menu()
    {
    cout << "Choices...................................................." << endl;
    cout << "-----------------------------------------------------------" << endl;
    cout << "\tReport...displays the report." << endl;
    cout << "\tQuit.....exits the program." << endl;
    cout << "-----------------------------------------------------------" << endl;
    }

  15. #15
    Registered User
    Join Date
    May 2010
    Posts
    4,633
    Please post a sample of your input file.

    Your code formatting has gotten worse, you need to find an indentation style you like and use it consistently. This will make your code much easier to read and follow your logic.

    Also what IDE/compiler are you using?

    Jim

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I don't know the cause of this segmentation fault
    By Dante McDaniels in forum C Programming
    Replies: 3
    Last Post: 02-05-2012, 02:35 AM
  2. Segmentation Fault
    By Dansas in forum C Programming
    Replies: 3
    Last Post: 11-21-2008, 02:12 PM
  3. Segmentation fault
    By bennyandthejets in forum C++ Programming
    Replies: 7
    Last Post: 09-07-2005, 05:04 PM
  4. Segmentation Fault
    By jat421 in forum C Programming
    Replies: 6
    Last Post: 04-03-2005, 02:26 PM
  5. segmentation fault and memory fault
    By Unregistered in forum C Programming
    Replies: 12
    Last Post: 04-02-2002, 11:09 PM