Interview Questions on Pointers in C


c interview questions

  1. What is a pointer in C?
  2. What are the advantages of using pointers?
  3. How is pass by reference achieved using pointers in C?
  4. What are the differences between malloc() and calloc()?
  5. How to use realloc() to dynamically increase size of an already allocated array?
  6. What is the equivalent pointer expression for referring an element a[i][j][k][l], in a four dimensional array?
  7. Declare an array of three function pointers where each function receives two integers and returns float.
  8. Explain the variable assignment in the declaration

    int *(*p[10])(char *, char *);
    
  9. What is the value of

    sizeof(a) /sizeof(char *)

    in a code snippet:

    char *a[4]={"sridhar","raghava","shashi","srikanth"};
  10. (i)What are the differences between the C statements below:

    char *str = "Hello";
    char arr[] = "Hello";
    

    (ii)Whether following statements get complied or not? Explain each statement.

    arr++;
    *(arr + 1) = 's';
    printf("%s",arr);
    


About the Author:  Sridhar Jammalamadaka is the Editor of Interview Mantra. He's a typically non-typical Software Engineer from Pune, India. He likes entrepreneurship, web technologies and Micro Controller programming. He enjoys playing cricket and piano (but rarely does these activities). Through this website, he wishes to gather a large community of aspiring engineers, entrepreneurs and professionals from all parts of the globe. You can connect with him on Facebook - http://www.facebook.com/sridhar.j



All comments of post - "Interview Questions on Pointers in C":

:Haha! I'am the first! Yeh~

Thank you!

Add a Comment / Trackback url

  1. #2  manjunathNo Gravatar

    Too good ….very much use full ….good work!!!!!!!!!!!!!

    10/02/27 18:22
  2. #1  kanthNo Gravatar

    very good

    09/12/15 11:49

Show all Show 5 so far Close all

Comment begin from here or jump up!