Hello
This is not a file only.
this is a project with about 200 files (c,h). and I write a file and add it to the project .the other files were compile without error but when runing my file the error segmentation fault apear.
I think when the equalitty t=mat1[i][j] the error accoured.
when the matrix is on the left hand side the error dont accoured such as mat1[i][j]=10;
I think that it is memory less error. in borland c when this error are accouring in options windows we check huge memory and this error is removed. but this option is'nt exist in kdeveloper (or I do'nt know it).
if you know this please help me.
input of project is a file and n is assigned from this file.
the complete project is in http://klamath.stanford.edu/TOOLS/SIM
Jonathan Bartlett <[EMAIL PROTECTED]> wrote:
I don't see where you are setting "n". Give a complete program as a
testcase and I'll look into it.

Jon

On Wed, 27 Aug 2003, reza saeidinia wrote:

> Hi.
> I hava a program that contains following codes :
> static int ** mat1=NULL;
> static int * a=NULL;
> mat1=(int **) malloc((sizeof (int *)*n));
> for (i=0; i> mat1[i]=(int *) malloc(sizeof(int)*n);
> a=(int *) malloc(sizeof(int)*n);
> for (i=0;i> for (j=0;j> mat1[i][j]=0;
> printf("ok");
> /*comment*/
> for(i=0;i> a[i]=0;
> printf("ok2");
> when I compile this code there is no error. but when run it (debbug) the program is executed until line /*comment*/ and the message "segmentation fault " apear.even if I delete line a[i]=0 from program the code printf("ok2") is'nt execute.
> how I can solve this problem?
> Regards.
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software


--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Reply via email to