On 1/07/2013 9:25 PM, Paul Gilmartin wrote:
On Mon, 1 Jul 2013 20:19:05 +0800, David Crayford wrote:

One thing you missed is the little known syntax of defining a pointer to
an array of fixed type lengths.

char (*array)[8];

Ugh!  I need to retrain myself every time I need to know that.

It's rare. But useful to know if you ever get a C programming test in an interview! I only know that syntax because I had to write a C interface to a message module written in assembler

#define variable(MSGTAB, norent)
char (*MSGTAB)[
for ( int i = 0;; i++)
{
    if ( memcmp( MSGTAB[i[, 0xFFFFFFFF, 8 )  == 0 ) break;
    printf( "%s.*s\n", sizeof MSGTAB[i], MSGTAB[i] );
}

On 1/07/2013 8:01 PM, Bernd Oppolzer wrote:
The compiler can immediately change every reference of the form

p[n]

to

*(p + n)

Or even to n[p], because addition is commutative.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to