Page 174 - DCAP404 _Object Oriented Programming
P. 174

Unit 8: Type Conversion




          3.   Discus which statements are does casting operator should satisfy.                Notes
          4.   Explicit type conversions between objects of different types lead, at best, to code that is
               difficult to read. Discuss.

          5.   The assignment operations cause automatic type conversion between the operand as per
               certain rules. Describe.
          6.   Two standard conversion sequences or two user-defined conversion sequences may have
               different ranks. Do you agree with this statement? Why or why not?
          7.   Scrutinize the standard conversion sequences.
          8.   Implicit conversions also include constructor or operator conversions, which affect classes
               that include specific constructors or operator functions to perform conversions. Explain
               with and example.

          9.   There  are  three  types  of  situations  that  arise  where  data  conversion are  between
               incompatible types. What are three situations explain briefly.
          10.  Write a program which the conversion of class type to basic type conversion.

          Answers: Self  Assessment

          1.   compiler                          2.  left

          3.   converted                         4.  parentheses
          5.   errors                            6.  explicit
          7.   specified type                    8.  typedef names

          9.   class or struct                   10.  return type
          11.  arguments                         12.  Conversion
          13.  Casting                           14.   Char
          15.  binary

          8.8 Further Readings




           Books      E Balagurusamy; Object-oriented Programming with C++; Tata Mc Graw-Hill.

                      Herbert Schildt; The Complete Reference C++; Tata Mc Graw Hill.
                      Robert Lafore; Object-oriented Programming in Turbo C++; Galgotia.



          Online links  http://www.bogotobogo.com/cplusplus/typecast.php

                      http://en.wikipedia.org/wiki/Type_conversion












                                           LOVELY PROFESSIONAL UNIVERSITY                                   167
   169   170   171   172   173   174   175   176   177   178   179