1. Question:What is a null pointer? 

    Answer
    There are times when it’s necessary to have a pointer that doesn’t point to anything. The macro NULL, defined in , has a value that’s guaranteed to be different from any valid pointer. NULL is a literal zero, possibly cast to void* or char*.
    
    Some people, notably C++ programmers, prefer to use 0 rather than NULL. 
    The null pointer is used in three ways:
    1) To stop indirection in a recursive data structure.
    2) As an error value.
    3) As a sentinel value.

    1. Report
  2. Question:Write down the equivalent pointer expression for referring the same element a[i][j][k][l] ? 

    Answer
    a[i] == *(a+i)
    a[i][j] == *(*(a+i)+j)
    a[i][j][k] == *(*(*(a+i)+j)+k)
    a[i][j][k][l] == *(*(*(*(a+i)+j)+k)+l)

    1. Report
  3. Question:What is a pointer? 

    Answer
    Pointer is a variable that contains address of another variable in the memory. Pointers are quite useful in creation of linked data structures (such as linked lst, trees graphs), managing object allocated memory dynamically, optimize the program to execute faster and use less memory.

    1. Report
  4. Question:What is the difference between ordinary variable and pointer in C? 

    Answer
    An ordinary variable is like a container it can hold any value and we can change the value of ordinary variable at a time throughout the program .A pointer is a variable that stores the address of another Variable.

    1. Report
  5. Question:How are pointer variables initialized? 

    Answer
    Pointer variable are initialized by one of the following two ways
    - Static memory allocation
    - Dynamic memory allocation

    1. Report
  6. Question:What is the meaning of multilevel pointers in c? 

    Answer
    A pointer is pointer to another pointer which can be pointer to others pointers and so on is known as multilevel pointers. We can have any level of pointers.

    1. Report
  7. Question:Are pointers integer? 

    Answer
    No, pointers are not integers. A pointer is an address. It is a positive number.

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