Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

I NEED TO CODE???

Name: Anonymous 2007-08-30 3:07 ID:XW6t9UTD

                    /* Put all coefficients to zero */
                    for (A = 0; A < 4; A++)
                    {
                        for (B = 0; B < 4; B++)
                        {
                            for (qq = 0; qq < 7; qq++)
                            {
                                for (ii = 0; ii < 3; ii++)
                                {
                                    for (ji = 0; ji < 3; ji++)
                                    {
                                        for (ki = 0; ki < 3; ki++)
                                        {
                                            coefg[A][B][ii][ji][ki][qq] = 0.0;
                                        }
                                    }
                                }
                            }
                        }
                    }

Name: Anonymous 2007-08-30 10:12 ID:HFqPJVTJ

From the Standard:

6.5.2.1 Array subscripting
Constraints
1 One of the expressions shall have type ‘‘pointer to object type’’, the other expression shall
have integer type, and the result has type ‘‘type’’.
Semantics
2 A postfix expression followed by an expression in square brackets [] is a subscripted
designation of an element of an array object. The definition of the subscript operator []
is that E1[E2] is identical to (*((E1)+(E2))). Because of the conversion rules that
apply to the binary + operator, if E1 is an array object (equivalently, a pointer to the
initial element of an array object) and E2 is an integer, E1[E2] designates the E2-th
element of E1 (counting from zero).
3 Successive subscript operators designate an element of a multidimensional array object.
If E is an n-dimensional array (n ≥ 2) with dimensions i × j × . . . × k, then E (used as
other than an lvalue) is converted to a pointer to an (n − 1)-dimensional array with
dimensions j × . . . × k. If the unary * operator is applied to this pointer explicitly, or
implicitly as a result of subscripting, the result is the pointed-to (n − 1)-dimensional array,
which itself is converted into a pointer if used as other than an lvalue. It follows from this
that arrays are stored in row-major order (last subscript varies fastest).

i'm not really sure if this means that the  the data in coefg is contigous in memory or not. I'd lean to "yes" given the evidence from the behaviour of the code.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List