Find jobs | Jobseekers
Employer login
About us Sitemap of www.CareerRide.com Sitemap FAQ related with www.CareerRide.com FAQ Click here to Contact us Contact
       
Submit Resume Free ! | Access Resume Free !
Home Career Services Resume Services Interview questions Articles Books

Interview Questions

C Interview questions

Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7  

C Interview Questions with Answers posted on August 06, 2008 at 13:10 PM by Amit Satpute

Question - Define the scope of static variables.

Answer
The scope of a static variable is local to the block in which the variable is defined. However, the value of the static variable persists between two function calls.

Question - What are volatile variables?

Answer
Volatile variables get special attention from the compiler. A variable declared with the volatile keyword may be modified externally from the declaring function.

If the keyword volatile is not used, the compiler optimization algorithms might consider this to be a case of infinite loop. Declaring a variable volatile indicates to a compiler that there could be external processes that could possibly alter the value of that variable.

e.g.:
A variable that might be concurrently modified by multiple threads may be declared volatile. Variables declared to be volatile will not be optimized by the compiler. Compiler must assume that their values can change at any time. However, operations on a volatile variable are still not guaranteed to be atomic.

Question - Explain the meaning of "Segmentation violation".

Answer
A segmentation violation usually indicates an attempt to access memory which doesn't even exist.

Question - What is "Bus error"?

Answer
A bus error indicates an attempt to access memory in an illegal way,perhaps due to an unaligned pointer.

C Interview Questions with Asnwers posted on July 20th, 2008 at 8:47 am by Siri

Question - Define recursion in C

Answer
A programming technique in which a function may call itself. Recursive programming is especially well-suited to parsing nested markup structures

Question - What does static variable mean in C?

Answer
static is an access qualifier that limits the scope but causes the variable to exist for the lifetime of the program. This means a static variable is one that is not seen outside the function in which it is declared but which remains until the program terminates. It also means that the value of the variable persists between successive calls to a function. The value of such a variable will remain and may be seen even after calls to a function. One more thing is that a declaration statement of such a variable inside a function will be executed only once.

Click here to share knowledge by answering these questions

  1. What does static variable mean in C? 
  2. Define pointer in C.
  3. Explain structure.
  4. List out differences between structures and arrays.
  5. Define macros. What are the advantages and disadvantages of Macros?
  6. List out differences between pass by reference and pass by value.
  7. Define static identifier in C?
  8. What are the auto variables? Where are they stored?
  9. List out differences between arrays and linked list?
  10. Explain the term enumerations in C.
  11. Describe about storage allocation and scope of global, extern, static, local and register variables?
  12. Define register variables? What are the advantage of using register variables?
  13. What is the use of typedef?
  14. Can we specify variable field width in a scanf() format string? If possible how?
  15. Out of fgets() and gets() which function is safe to use and why?
  16. List out differences between strdup and strcpy.
  17. Define recursion in C. 
  18. Explain the term macros in C.
  19. What is the difference between char *a and char a[]?
  20. What is a NULL pointer? How is a NULL pointer defined?
  21. Define void pointer.
  22. What is a const pointer?
  23. Explain memory leak.
  24. What is the difference between malloc() and calloc()?
  25. What is static memory allocation and dynamic memory allocation?
  26. What is a const pointer?
  27. What is the purpose of main( ) function?
  28. What is the differece between #define and constant in C?
  29. What are storage class in c?
  30. Difference between Funtion to pointer and pointer to function
  31. What is the difference between a string and an array?

Click here to share knowledge by answering these questions

 

 
Today's Hot Jobs
C++  SQL Server
.NET  Java  Oracle
Finance  Marketing
Seekers  Employers
Copyright © 2008 CareerRide.com. All rights reserved.