This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.

Index Nav: Message Nav: [Date Index] [Subject Index] [Author Index] [Thread Index] [Date Prev] [Date Next] [Thread Prev] [Thread Next] [Raw text]

# cygwin gcc and arrays -- Possible bug???

• From: Cynthia Randles <crandles at Princeton dot EDU>
• To: cygwin at cygwin dot com
• Date: Tue, 27 Aug 2002 19:09:23 -0400
• Subject: cygwin gcc and arrays -- Possible bug???
• Organization: Princeton University

```I was wondering if anyone could help me.
I have the following lines of code:

for (i = 0; i <=  NUMBINS; ++i)
{
printf("The value if i is %d\n", i);
fscanf(ifp2, "%f\n", &volfraction);

printf("The value of volfraction is %f\n", volfraction);
vol_array[i] = volfraction;
printf("The volfraction is vol_array[%d]=%f\n", i, vol_array[i]);
printf("----------end of read in input file------\n\n");
}

which, in cygwin produces:

The value of i is 0
The value of radius is 0.200000

The value of volfraction is 0.330000
The volfraction is vol_array=0.330000
The value of rad_array is 0.330000
----------end of read in input file-----

as you can see, for some reason rad_array is being reassigned even
though I never ask for that!!!

my red-hat linux gcc produces:

The value of i is 0
The value of radius is 0.200000

The value of volfraction is 0.330000
The volfraction is vol_array=0.330000
The value of rad_array is 0.200000
----------end of read in input file-----

which is the right answer.  I cannot figure out what is going
on with cygwin, and I haven't found a post that can help me.  Any
help is appreciated.

Thanks,
Cynthia

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

```

Index Nav: Message Nav: [Date Index] [Subject Index] [Author Index] [Thread Index] [Date Prev] [Date Next] [Thread Prev] [Thread Next]