Page 258 - DCAP404 _Object Oriented Programming
P. 258

Unit 11: Pointers and Dynamic Memory Management




                 x[i]  =  i  +  3;                                                              Notes
                 y  =  z;
                 x  =  y;
               }
          7.   Discuss two different ways of accessing array elements.
          8.   Write a program to traverse an array using pointer.

          9.   Write a program to compare two strings using pointer.
          10.  Can we convert a pointer-to-function to a void*? Explain with an example.

          Answers: Self  Assessment

          1.   memory                            2.  ‘&’
          3.   indirection                       4.  unique

          5.   integers                          6.  comparison
          7.   declaration                       8.  address
          9.   invoked                           10.  directly
          11.  memory heap                       12.  statically
          13.  [ ]                               14.  This

          15.  X*

          11.9 Further Readings




           Books      E Balagurusamy; Object-oriented Programming with C++; Tata Mc Graw-Hill.
                      Herbert Schildt; The Complete Reference C++; Tata Mc Graw Hill.
                      Object Oriented Programming with C++; Cyber tech publications




          Online links  http://publib.boulder.ibm.com/infocenter/comphelp/v8v101 index.jsp?topic=
                      %2Fcom.ibm.xlcpp8a.doc%2Flanguage%2Fref%2Fcplr035.htm

                      http://www.cplusplus.com/doc/tutorial/pointers/




















                                           LOVELY PROFESSIONAL UNIVERSITY                                   251
   253   254   255   256   257   258   259   260   261   262   263