C interview questions – page 4

2,130 questions. Tap “Show answer” to check yourself.

Advertisement
  1. why java is called as a purely oops language.

  2. difference between my-strcpy and strcpy ?

  3. Write a program to exchange two variaables without temp

  4. Define function ?Explain about arguments?

  5. C passes By value or By reference?

  6. f() { int a=2; f1(a++); } f1(int c) { printf("%d", c); } c=?

  7. f1() { f(3);} f(int t) { switch(t); { case 2: c=3; case 3: c=4; case 4: c=5; case 5: c=6; default: c=0;} value of c?

  8. What does the message "warning: macro replacement within a string literal" mean?

  9. AMMONG THE 4 STROAGE CLASSES IN C, WHICH ONE FASTEST?

  10. a=0; b=(a=0)?2:3; a) What will be the value of b? why b) If in 1st stmt a=0 is replaced by -1, b=? c) If in second stmt a=0 is replaced by -1, b=?

  11. How does free() know how many bytes to free?

  12. What's the difference between calloc() and malloc()?

  13. Advertisement
  14. When you call malloc() to allocate memory for a local pointer, do you have to explicitly free() it?

  15. What does a run-time "null pointer assignment" error mean?

  16. what is meant by the "equivalence of pointers and arrays" in C?

  17. How do I declare a pointer to an array?

  18. How can I set an array's size at run time?

  19. What's a "sequence point"?

  20. Why doesn't the code "int a = 1000, b = 1000; long int c = a * b;" work?

  21. What's wrong with "char *p; *p = malloc(10);"?

  22. I have a function which accepts, and is supposed to initialize,a pointer, but the pointer in the caller remains unchanged.

  23. I have a function which accepts a pointer to an int. How can I pass a constant like 5 to it?

  24. Can I pass constant values to functions which accept structure arguments?

  25. Why doesn't the code "a[i] = i++;" work?

  26. Advertisement
  27. What is the difference between char a[] = "string"; and char *p = "string"; ?

  28. How do I initialize a pointer to a function?

  29. What's the difference between struct x1 { ... }; and typedef struct { ... } x2; ?

  30. What does extern mean in a function declaration?

  31. How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?

  32. What's wrong with "char *p = malloc(10);" ?

Advertisement