1. Question:Why Pre-increment operator is faster than Post-increment? 

    Answer
    Evaluation of any expression is from left to right. Preincrement is faster because it doesn't need to save the current value for next instruction whereas Postincrement needs to saves current value to be incremented after execution of current instruction.

    1. Report
  2. Question:What is the use of typedef? 

    Answer
    (i) It increases the portability.
    (ii) It simplify the complex declaration and improve readability of the program.

    1. Report
  3. Question:When should a type cast be used? 

    Answer
    There are two situations in which to use a type cast. The first use is to change the type of an operand to an arithmetic operation so that the operation will be performed properly.
    The second case is to cast pointer types to and from void * in order to interface with functions that expect or return void pointers. For example, the following line type casts the return value of the call to malloc() to be a pointer to a foo structure.
    struct foo *p = (struct foo *) malloc(sizeof(struct foo));

    1. Report
Copyright © 2024. Powered by Intellect Software Ltd