C Programming Interview Questions and Answers - 3
Question: 11
What is the syntax for comments in C?
Below is the syntax for comments in C. The characters or words or anything which are given between “/*” and “*/”, won’t be considered by C compiler for compilation process. These will be ignored by C compiler during compilations.
Syntax : /* your comments here */
Question: 12
What is file pointer in C?
File pointer is a pointer which is used to handle and keep track on the files being accessed. A new data type called FILE is used to declare file pointer. This data type is defined in stdio.h file. File pointer is declared as FILE *fp. Where, ‘fb’ is a file pointer.
fopen() function is used to open a file that returns a FILE pointer. Once file is opened, file pointer can be used to perform I/O operations on the file. fclose() function is used to close the file.
Question: 13
What are runtime errors?
These are errors that occur which the program is being executed.
One common instance wherein run time errors can happen is when you are trying to divide a number by zero. When a run time errors occur, program execution will pause, showing which program line caused the error.
Question: 14
What is stack?
A stack is one form of data structure. Data is stored in stacks using the FILO (First In Last Out) approach.
At any particular instance, only the top of the stack is accessible. Which means that in order to retrieve data that is stored inside the stack, those on the upper part should be extracted first. Storing data in a stack is also referred to as a PUSH, while data retrieval is referred to as a POP.
Question: 15
What is stack memory allocation and dynamic memory allocation?
The compiler allocates the required memory space for a declared variable. By using the address of a operator, the reserved address is obtained and this address may be assigned to a pointer variable. Since, most of the declared variable has static memory, this way of assigning pointer value to a pointer variable is known as static memory allocation. Memory is assigned during compilation time.
Dynamic memory allocation: it uses functions such as malloc() or calloc() to get memory dynamically. If these functions are used to get memory dynamically and the values returned by these functions are assigned to pointer variables, such assignments are known as dynamic memory allocation. Memory is assigned during run time.
- Top 500+ C Language Interview Questions and Answers Pdf
- C Language Interview Questions and Answers
- C Language Interview Questions and Answers for Freshers
- C Language Interview Questions and Answers for Experienced
- C Programming Interview Questions and Answers
- Embedded C Interview Questions and Answers Pdf
- Top 200+ Advanced C Language Interview Questions 2020-2021
- C Programming Question Bank with Answers Pdf
- C Programming Interview Questions and Answers for Freshers
- C Programming Interview Questions and Answers for Experienced
- C Programming Basics Questions and Answers Pdf
- 1000+ Advanced C Programming Interview Questions & Answers
- 1000+ C Interview Questions and Answers 2023 - 2024 Pdf
- 1000+ C Programming Coding Questions and Answers
- 1000+ C Basic Interview Questions for Freshers Pdf
- 1000+ C Questions and Answers Pdf
Control System Questions and Answers Pdf More
GATE Analog Electronics MCQ Questions and Answers More
Analog Electronics Questions Pdf Download with Answers More
Engineering Materials Science MCQ Questions & Answers More
Material Science MCQ Questions Pdf Download More
1000+ DBMS Quiz Questions with Answers More
Indian National Movement MCQ Questions with Answers Pdf More
100+ LCM and HCF Questions and Answers for Bank Exams More
Top 150+ MS Windows Quiz Questions with Answers 2020-2021 More
50+ Arithmetic Reasoning Questions and Answers Pdf More