[Ilugc] C pgm - Recursive -segmentation fault

  • From: karthick.sundararajan@xxxxxxxxx (karthick.sundararajan@xxxxxxxxx)
  • Date: Tue Sep 14 11:40:09 2004


It is (*ptr = 5). The idea is to show that it is succeeding.
Rgds,
Karthick

(c)-----Original Message-----
(c)From: Kannan_Ranganathan [mailto:Kannan_Ranganathan@xxxxxxxxxx]
(c)Sent: Tuesday, September 14, 2004 11:37
(c)To: Karthick Sundararajan; ilugc@xxxxxxxxxxxxx
(c)Subject: RE: [Ilugc] C pgm - Recursive -segmentation fault
(c)Importance: High
(c)
(c)
(c)Is it  if(*ptr = 5) or if(*ptr == 5)
(c)
(c)If its if(*ptr = 5) then any version shld allow this ???
(c)
(c)If its if(*ptr == 5) then TC is also not allowing ...
(c)
(c)
(c)But I do agree with you to a great extent.
(c)
(c)Regards
(c)Kannan
(c)
(c)
(c)-----Original Message-----
(c)From: karthick.sundararajan@xxxxxxxxx
(c)[mailto:karthick.sundararajan@xxxxxxxxx]
(c)Sent: Tuesday, September 14, 2004 11:29 AM
(c)To: Kannan_Ranganathan; ilugc@xxxxxxxxxxxxx
(c)Subject: RE: [Ilugc] C pgm - Recursive -segmentation fault
(c)
(c)
(c)Please don't believe TC for segmentation faults. It is not reliable
in
(c)segmentation faults area. Try this code:
(c)#include <stdio.h>
(c)
(c)void main()
(c){
(c)     int *ptr = (int*)0;
(c)
(c)     if(*ptr = 5)
(c)     {
(c)             printf("It worked");
(c)     }
(c)}
(c)
(c)     To the best of my knowledge it works more times than not.
(c)
(c)     I think that is because DOS gives the whole of the
(c)avaibale memory
(c)for the program under execution.
(c)
(c)     Also, the best that can be expected is that TC will get
(c)closed in
(c)such cases.
(c)
(c)
(c)     Cheers,
(c)     Karthick S.
(c)     Mobile Number: 9884025911
(c)     Home Page: www.geocities.com/sksatyam
(c)
(c)
(c)(c)-----Original Message-----
(c)(c)From: ilugc-bounces@xxxxxxxxxxxxx
(c)
(c)(c)[mailto:ilugc-bounces@xxxxxxxxxxxxx] On Behalf Of
Kannan_Ranganathan
(c)(c)Sent: Tuesday, September 14, 2004 11:21
(c)(c)To: ilugc@xxxxxxxxxxxxx
(c)(c)Subject: RE: [Ilugc] C pgm - Recursive -segmentation fault
(c)(c)Importance: High
(c)(c)
(c)(c)
(c)(c)Hi
(c)
(c)(c) I did the same thing in office (this time its TC+XP) here too
(c)
(c)(c)it seems to
(c)(c)run forever .
(c)(c)
(c)(c)However On my office PC  RH9 gcc3.2.2 it gives a segmentation
fault
(c)
(c)(c)
(c)(c)
(c)(c)Regards
(c)
(c)(c)Kannan
(c)
(c)(c)***************************************************************
(c)(c)***********
(c)
(c)(c)This email (including any attachments) is intended for the
(c)
(c)(c)sole use of the
(c)(c)intended recipient/s and may contain material that is
(c)CONFIDENTIAL AND
(c)(c)PRIVATE COMPANY INFORMATION. Any review or reliance by others
(c)
(c)(c)or copying or
(c)(c)distribution or forwarding of any or all of the contents in
(c)
(c)(c)this message is
(c)(c)STRICTLY PROHIBITED. If you are not the intended recipient,
(c)
(c)(c)please contact
(c)(c)the sender by email and delete all copies; your cooperation in
(c)
(c)(c)this regard
(c)(c)is appreciated.
(c)(c)***************************************************************
(c)(c)***********
(c)(c)
(c)
(c)(c)
(c)(c)
(c)
(c)
(c)Confidentiality Notice
(c)
(c)
(c)The information contained in this electronic message and any
(c)attachments to
(c)this message are intended for the exclusive use of the
(c)addressee(s) and may
(c)contain confidential or privileged information. If you are not
(c)the intended
(c)recipient, please notify the sender at Wipro or Mailadmin@xxxxxxxxx
(c)immediately and destroy all copies of this message and any
attachments.
(c)***************************************************************
(c)***********
(c)This email (including any attachments) is intended for the
(c)sole use of the
(c)intended recipient/s and may contain material that is CONFIDENTIAL
AND
(c)PRIVATE COMPANY INFORMATION. Any review or reliance by others
(c)or copying or
(c)distribution or forwarding of any or all of the contents in
(c)this message is
(c)STRICTLY PROHIBITED. If you are not the intended recipient,
(c)please contact
(c)the sender by email and delete all copies; your cooperation in
(c)this regard
(c)is appreciated.
(c)***************************************************************
(c)***********
(c)


Confidentiality Notice

The information contained in this electronic message and any attachments to 
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or 
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or 
Mailadmin@xxxxxxxxx immediately
and destroy all copies of this message and any attachments.

Other related posts: