C Programming Interview Questions
General Questions IV
C Program - General Questions
- How will you print “Hello World” without semicolon?
- What are different storage class specifiers in C?
- What is scope of a variable? How are variables scoped in C?
- When should we use pointers in a C program?
- What is NULL pointer?
- What is Dangling pointer?
- What is memory leak? Why it should be avoided
- What are static functions? What is their use?
- How many parameters should a function have?
- What is a static function?
- Should a function contain a return statement if it does not return a value?
- How can you pass an array to a function by value?
- Is it possible to execute code even after the program exits the main() function?
- The standard C library provides a function named atexit() that can be used to perform "cleanup" operations when your program terminates.
- What does a function declared as PASCAL do differently?
- Differentiate exit(), return, break..?
- What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When
- should each be used?
- How can I remove the trailing spaces from a string?
- How can I remove the leading spaces from a string?
- How can I convert a number to a string?
- How can I convert a string to a number?
- What is “##” operator in C?
- What is the use of “#define” in C?
- How will you check whether macro is defined or not in a C program?
- What is the difference between memcpy() and memmove() functions in C?
- What is void pointer in C?
- What is wild pointer in C?
- What is file pointer in C?
- What is const pointer in C?
- What is the difference between null and zero?
- What is the difference between null pointer and uninitialized pointer in C?
- What happens when we try to access null pointer in C?
- What is meant by segmentation fault or memory fault in C?
- What is meant by core dump in C?
- Can a pointer be freed more than once in C? What happens if we do so? Or can a pointer be freed twice in C?
- Can variable name be start with underscore in C?
- What is inline function in C?
- What is extern and static function in C?
- Explain storage class in c
- How will you swap 2 variables without using temp variable in C?
- What is operator precedence in C?
- What is the use of bit field in C?
- What is bus error in C?
- Is it possible to reduce executable file size in C and how?
- What is stack memory in C?
- What is heap memory in C?
- In which memory, local variables are stored in C?
- In which memory, malloc(), calloc() ( dynamic memory functions ) are stored in C?
- While passing an array to a function as an argument, what actually is passed?
- What is high order and low order bytes in C?
- What is the maximum number of arguments that can be passed to a function?
- Do you know why is semicolon used at the end of each line in C programs?
- Explain the # pragma directive.