C Programming Interview Questions and Answers-1

Q: – Explain about storage of union elements.
The key point about storage of union elements is that Union elements are use to share common memory space.
Q: – What is a memory leak?
Memory leak is that when memory is allocated but its not released because of an application consume memory reducing the available memory for other applications and causing the system to page virtual memory to the hard drive showing the application or crashing the application. When the computer memory resource limits are reached.
Q: – Is C is platform dependent or independent?how and why?
Major issue behind designing C language is that it is a small,portable programming language. It is used to implement an operating system.In past time C is a powerful tool for writing all types of program and has mechanism to achieve all most programming goals.So, we can say that C is platform dependent.
Q: – What are the stream files?
We can open file in C with using stream files.which are identified with a pointer to a FILE structure, or as low-level files, which are identified with an integer handle.
We can open stream files with using one of the following functions.
fopen(): Opens the specified file with the specified mode
freopen(): Closes the file specified, then opens a new file as specified
fdopen(): Opens a duplicate stream file for an already open low-level file
Q: – How the processor registers can be used in C?
using keyword register we can use the process register in C.Basically process register is used to store variables those i want to access frequently.if these registers are not used in any other program,then those registers we used to allocate memory these variables.
Q: – How to access or modify the const variable in C ?
We can not modify the constant variable.
Q: – Why n++ executes faster than n+1?
n++ executes faster than n+1 because n++ want only one instruction for execution where n+1 want more one instruction for execution.
Q: – What is the difference between the Heap and the Stack?
The main difference b/n the Heap and the Stack are given below:

  • In stack we create object temporary where programmer used to reserve allocation.’
  • stack not have automatic garbage collection where as heap have automatic garbage collection.

Q: – What is the Double LinkedList?
Double Linked List is that each data item in the list can point both side(next or previous)data item.It is not specific type means it may be of stack or queue.This is use to increase the performance of program.It is also called as Two-way Linked List or Symmetrically Linked list.
Q: – What are the advantages of high-level programming languages?
Readability, maintainability, and portability

Tagged , . Bookmark the permalink.

Leave a Reply