The greatest mistake you can make in life is to be continually fearing you will make one

Monday 10 May 2010

Questions on Pointers

  1. What is pointer?
  2. What is NULL pointer?Is it same as uninitialized pointer?
  3. What does the error 'NULL Pointer Assignment' mean and what causes this error?
  4. Difference between NULL pointer and NULL macro?
  5. What is far pointer? Where we use it?http://www.blogger.com/post-edit.g?blogID=3012383994992801642&postID=2425531620599867473
  6. What are near,far and huge pointers? How many bytes are occupied by them?
  7. When you reallocate the memory which is currently referenced by several other pointers, do you have to readjust these other pointers or do they get readjusted automatically?
  8. Write down the equivalent pointer expression for referring the element a[i][j][k][l]?
  9. Advantages of using pointers in programs?
  10. Declare the following

    1. array of 3 pointers to chars
    2. array of 3 char pointers
    3. pointer to array of 3 chars
    4. pointer to function that receieves int pointer and returns float pointer
    5. pointer to function that receieves nothing and returns nothing
  11. How will you declare array of three function pointers where each function receives two ints and returns float?
  12. What is the size of pointer variable in C?How to calculate the size of pointer?
        size of pointer can be calculated by using sizeof() operator. Pointer stores the address of the variable. Address of variable is always an integer value. Storing integer value require 4bytes(32 bit compiler). So pointer variable require 4 bytes of memory
  13. What is the size of void pointer variable in c?
    void *ptr;
    sizeof(ptr)?
  14. What is the size of const pointer variable in C?
  15. Which pointer require more memory space int or character pointer?
        Size of pointer variable does not depends upon data type. Pointer variable only stores the address of the variable. Address is always integer value. So size of pointer variabl of any type is 4 bytes(32 bit compiler)
  16. Write the equivalent pointer expression for the following array variables?
    1. a[i][j]
    2. a[i][j][k]
    3. a[i][j][k][l]

No comments:

Post a Comment