Followers

About this blog

who is the founder of reliance group?

Pages

C Interview Questions

Define the scope of static variables.

The scope of a static variable is local to the block in which the variable is defined..............
Read answer

What are volatile variables?

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

Explain the meaning of "Segmentation violation".

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

What is "Bus error"?

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

Define recursion in C

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

What does static variable mean in C?

static is an access qualifier that limits the scope but causes the variable to exist for the lifetime of the program....................
Read answer

List out differences between structures and arrays

The following are the differences between structures and arrays: - Array elements are homogeneous. Structure elements are of different data type.............
Read answer

Define macros. What are the advantages and disadvantages of Macros?

A macro is a name given to a block of C statements as a pre-processor directive. Being a pre-processor, the block of code is communicated to the compiler before entering............
Read answer

List out differences between pass by reference and pass by value

Pass by value always invokes / calls the function or returns a value that is based on the value. This value is passed as a constant or a variable with value.............
Read answer

Define static identifier in C?

The static identifier is used for initializing only once, and the value retains during the life time of the program / application. A separate memory is allocated for ‘static’ variables............
Read answer

What are the auto variables? Where are they stored?

The auto variables are stored in the memory of the system. The keyword ‘auto’ is optional. Many of the variables used by the program.............
Read answer

List out differences between arrays and linked list

The difference between arrays and linked lists are: - Arrays are linear data structures. Linked lists are linear and non-linear data structures............
Read answer

Explain the term enumerations in C

A set of named integer constants is known as an enumeration. The enumeration type declaration includes the name of the enumeration tag and the definition of a set of named integers............
Read answer

Describe about storage allocation and scope of global, extern, static, local and register variables

The storage allocation / class determine the memory part where the storage space is allocated for variables, functions and how long the allocation of storage continues to exist............
Read answer

Define register variables. What are the advantages of using register variables?

The variables of ‘register’ type modifier will inform the compiler for storing the variables in a register of CPU.............
Read answer

What is the use of typedef?

The keyword typedef is used for defining user defined data types. A new definition of existing data types is created by using typedef...............
Read answer

Can we specify variable field width in a scanf() format string? If possible how?

It is possible to specify variable field width in a scanf() format string. By using %s control string...........
Read answer

Out of fgets() and gets() which function is safe to use and why?

The function fgets() function is safer to use. It checks the bounds.........
Read answer

List out differences between strdup() and strcpy()

The function strcpy() will not allocate the memory space to copy..............
Read answer

What is the difference between char *a and char a[]?

For char[] array, such size is not accepted by the compiler. If the size is specified, the following are the differences between char *a and char a[]...........
Read answer

Define void pointer

A void pointer is pointer which has no specified data type. The keyword ‘void’ is preceded the pointer variable.............
Read answer

What is a const pointer?

A const pointer is not the pointer to constant, it is the constant. For example, int* const ptr; indicates that ptr is a pointer..............
Read answer

Explain memory leak

An unwanted increase in programs is referred as a memory leak is C language. The intake of program increases...............
Read answer

What is static memory allocation and dynamic memory allocation?

Static Memory Allocation: Memory is allocated for the declared variable by the compiler............
Read answer

What is the purpose of main( ) function?

The function main() calls / invokes other functions within it. The execution of the program always starts with main() function...........
Read answer

What is the difference between #define and constant in C?

A #define is used as immediate constant or as a macro. Where as the constant is a variable whose value can not change.............
Read answer

What are storage class in c?

The scope and lifetime of a variable or / and function within a C program is defined by storage class. There are four storage classes in C............
Read answer

Difference between Function to pointer and pointer to function

A function to pointer is one which returns a pointer.............
Read answer

What is the difference between a string and an array?

The following are the differences: - String can hold only char data. Where as an array can hold any data type.............
Read answer

What are bitwise shift operators?

<< - Bitwise Left-Shift
Bitwise Left-Shift is useful when to want to MULTIPLY an integer (not floating point numbers) by a power of 2....................
Read answer

Explain the use of bit fieild.

Bit Fields allow the packing of data in a structure. This is especially useful when memory or data storage is at a premium................
Read answer

Explain the scope of static variables.

The scope of a static variable is local to the block in which the variable is defined..............
Read answer

What is the purpose of "register" keyword.

It is used to make the computation faster.
The register keyword tells the compiler to store the variable onto the CPU register if space on the register is available. However, this is a very old technique..............
Read answer

Explain the use of "auto" keyword.

When a certain variable is declared with the keyword ‘auto’ and initialized to a certain value.............
Read answer

Explain function prototype.

A function prototype is a mere declaration of a function. It is written just to specify that there is a function that exists in a program..............
Read answer

What is the purpose of "extern" keyword in a function declaration?

The declaration of functions defaults to external linkage. The only other storage class possible for a function is static..............
Read answer

Explain the use of fflush() function.

In ANSI, fflush() [returns 0 if buffer successfully deleted / returns EOF on an error] causes the system to empty the buffer associated with the specified output stream...........
Read answer

Explain the difference between malloc() and calloc() function.

Both functions are used to dynamically allocate the memory.................
Read answer

Explain the difference between strcpy() and memcpy() function.

strcpy() copies a string until it comes across the termination character ‘\0’. With memcopy(), the programmer needs to specify the size of data to be copied..............
Read answer

Explain the difference between exit() and _exit() function.

exit() does cleanup work like closing file descriptor, file stream and so on, while _exit() does not.
Read answer

Compare array with pointer.

The following declarations are NOT the same:
char *p;
char a[20];........................
Read answer

What is NULL pointer?

A null pointer does not point to any object..............
Read answer

Define #pragma statements.

The #pragma Directives are used to turn ON or OFF certain features. They vary from compiler to compiler.
Examples of pragmas are:..................
Read answer

Describe the advantages of using macro.

In modular programming, using functions is advisable when a certain code is repeated several times in a program...............
Read answer

Explain with an example the self-referential structure.

A self referential structure is used to create data structures like linked lists, stacks, etc. Following is an example of this kind of structure:....................
Read answer

Describe structures and Union in brief.
What are the properties of Union?

Define the scope of static variables.

The scope of a static variable is local to the block in which the variable is defined..............
Read answer

What are volatile variables?

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

Explain the meaning of "Segmentation violation".

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

What is "Bus error"?

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

Define recursion in C

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

What does static variable mean in C?

static is an access qualifier that limits the scope but causes the variable to exist for the lifetime of the program....................
Read answer

List out differences between structures and arrays

The following are the differences between structures and arrays: - Array elements are homogeneous. Structure elements are of different data type.............
Read answer

Define macros. What are the advantages and disadvantages of Macros?

A macro is a name given to a block of C statements as a pre-processor directive. Being a pre-processor, the block of code is communicated to the compiler before entering............
Read answer

List out differences between pass by reference and pass by value

Pass by value always invokes / calls the function or returns a value that is based on the value. This value is passed as a constant or a variable with value.............
Read answer

Define static identifier in C?

The static identifier is used for initializing only once, and the value retains during the life time of the program / application. A separate memory is allocated for ‘static’ variables............
Read answer

What are the auto variables? Where are they stored?

The auto variables are stored in the memory of the system. The keyword ‘auto’ is optional. Many of the variables used by the program.............
Read answer

List out differences between arrays and linked list

The difference between arrays and linked lists are: - Arrays are linear data structures. Linked lists are linear and non-linear data structures............
Read answer

Explain the term enumerations in C

A set of named integer constants is known as an enumeration. The enumeration type declaration includes the name of the enumeration tag and the definition of a set of named integers............
Read answer

Describe about storage allocation and scope of global, extern, static, local and register variables

The storage allocation / class determine the memory part where the storage space is allocated for variables, functions and how long the allocation of storage continues to exist............
Read answer

Define register variables. What are the advantages of using register variables?

The variables of ‘register’ type modifier will inform the compiler for storing the variables in a register of CPU.............
Read answer

What is the use of typedef?

The keyword typedef is used for defining user defined data types. A new definition of existing data types is created by using typedef...............
Read answer

Can we specify variable field width in a scanf() format string? If possible how?

It is possible to specify variable field width in a scanf() format string. By using %s control string...........
Read answer

Out of fgets() and gets() which function is safe to use and why?

The function fgets() function is safer to use. It checks the bounds.........
Read answer

List out differences between strdup() and strcpy()

The function strcpy() will not allocate the memory space to copy..............
Read answer

What is the difference between char *a and char a[]?

For char[] array, such size is not accepted by the compiler. If the size is specified, the following are the differences between char *a and char a[]...........
Read answer

Define void pointer

A void pointer is pointer which has no specified data type. The keyword ‘void’ is preceded the pointer variable.............
Read answer

What is a const pointer?

A const pointer is not the pointer to constant, it is the constant. For example, int* const ptr; indicates that ptr is a pointer..............
Read answer

Explain memory leak

An unwanted increase in programs is referred as a memory leak is C language. The intake of program increases...............
Read answer

What is static memory allocation and dynamic memory allocation?

Static Memory Allocation: Memory is allocated for the declared variable by the compiler............
Read answer

What is the purpose of main( ) function?

The function main() calls / invokes other functions within it. The execution of the program always starts with main() function...........
Read answer

What is the difference between #define and constant in C?

A #define is used as immediate constant or as a macro. Where as the constant is a variable whose value can not change.............
Read answer

What are storage class in c?

The scope and lifetime of a variable or / and function within a C program is defined by storage class. There are four storage classes in C............
Read answer

Difference between Function to pointer and pointer to function

A function to pointer is one which returns a pointer.............
Read answer

What is the difference between a string and an array?

The following are the differences: - String can hold only char data. Where as an array can hold any data type.............
Read answer

What are bitwise shift operators?

<< - Bitwise Left-Shift
Bitwise Left-Shift is useful when to want to MULTIPLY an integer (not floating point numbers) by a power of 2....................
Read answer

Explain the use of bit fieild.

Bit Fields allow the packing of data in a structure. This is especially useful when memory or data storage is at a premium................
Read answer

Explain the scope of static variables.

The scope of a static variable is local to the block in which the variable is defined..............
Read answer

What is the purpose of "register" keyword.

It is used to make the computation faster.
The register keyword tells the compiler to store the variable onto the CPU register if space on the register is available. However, this is a very old technique..............
Read answer

Explain the use of "auto" keyword.

When a certain variable is declared with the keyword ‘auto’ and initialized to a certain value.............
Read answer

Explain function prototype.

A function prototype is a mere declaration of a function. It is written just to specify that there is a function that exists in a program..............
Read answer

What is the purpose of "extern" keyword in a function declaration?

The declaration of functions defaults to external linkage. The only other storage class possible for a function is static..............
Read answer

Explain the use of fflush() function.

In ANSI, fflush() [returns 0 if buffer successfully deleted / returns EOF on an error] causes the system to empty the buffer associated with the specified output stream...........
Read answer

Explain the difference between malloc() and calloc() function.

Both functions are used to dynamically allocate the memory.................
Read answer

Explain the difference between strcpy() and memcpy() function.

strcpy() copies a string until it comes across the termination character ‘\0’. With memcopy(), the programmer needs to specify the size of data to be copied..............
Read answer

Explain the difference between exit() and _exit() function.

exit() does cleanup work like closing file descriptor, file stream and so on, while _exit() does not.
Read answer

Compare array with pointer.

The following declarations are NOT the same:
char *p;
char a[20];........................
Read answer

What is NULL pointer?

A null pointer does not point to any object..............
Read answer

Define #pragma statements.

The #pragma Directives are used to turn ON or OFF certain features. They vary from compiler to compiler.
Examples of pragmas are:..................
Read answer

Describe the advantages of using macro.

In modular programming, using functions is advisable when a certain code is repeated several times in a program...............
Read answer

Explain with an example the self-referential structure.

A self referential structure is used to create data structures like linked lists, stacks, etc. Following is an example of this kind of structure:....................
Read answer

Describe structures and Union in brief.
What are the properties of Union?

Category: 0 comments

0 comments:

Post a Comment

Search This Blog

Blog Archive