Isnin, 26 Mac 2012

POINTER - PART II


1.       What is wrong with the following code:

        Short a [32];

        for( int i = 0; i < 32; i++)

       *a++ = i*i;

2.       Determine the value of each of the indicated variables after the following code executes. Assume that each integer occupies 4 bytes and that m is stored in memory starting at byte 0x3ffd00.

                   int m = 44;

                  int* p = &m;

                  int&  r = m;

                  int n = (*p) ++;

                  int* q = p – 1;

                  r = * (--p) + 1;

                   ++*q;

a.                   m


b.                   n


c.                     &m


d.                    *p


e.                   r


f.                    *q


2 ulasan:

  1. Ulasan ini telah dialihkan keluar oleh pengarang.

    BalasPadam
    Balasan
    1. Ye atikah tak faham yang mane?
      Maaf terpadam komen tu.
      Soalan ni minta awak dapatkan nilai pembolehubah yang disenaraikan dari a - f.

      Padam