Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/purvgwtw/public_html/tutorials/common.php on line 7
C Interview Questions & Answers
Sponsered Links
Categories
Sponsered Links

C Interview Questions & Answers

 Differentiate between Structure and Union?
The Main difference is Structure is Allocate the memory in as per the Data type. But Union is Allocate the Memory in max size of Declare the variable to all.

What is File Mode?. Define types Of file mode?.

In which mode we want to open the file. Types of modes are read mode, write mode.

Define Pointer? Which is one of the most useful in Structure or Union?.

Pointer is the variable which holds the address of another variable. Union are useful because of memory no wastage but structures are often used than unions.

Differentiate between global static and static variable?

Global variables can be define anywhere in the program and they can be use any time's . Static variable defines the inside the functions and the value of static variables can not change in the program.

Define abstract base class?

A class that has at least one pure virtual function. Abstract classes are used for achieving polymorphism.

Differentiate a do statement and a while statement?

A do statement checks at the end of a loop to see whether the next iteration of a loop should occur. T A while statement checks at the beginning of a loop to see whether the next loop iteration should occur.

Define meaning of "Segmentation violation"?

A segmentation violation is commonly indicates an attempt to access memory which does not even exist.

what's scope of static variables.

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

Differentiate between malloc() and calloc() function?

Both functions are used to dynamically allocate the memory. The difference is that calloc initializes are the allocated memory to zero or Null while malloc contains garbage values.

Define NULL pointer?

A null pointer does not point to any object. NULL and zero are interchangeable in pointer contexts. NULL should not be used when another kind of 0 is required.

Define the advantages of using macro?

Every time a function is called the control gets transferred to that function and then back to the calling function. This consumes a lot of execution time. One way to save this time is by using macros. Macros substitute a function call by the definition of that function. This saves are execution time to a great extent.

Differentiate between getch() & scanf()?

In scanf() we can enter more than one data type of different data type and it needs to enter a enter key to enter .But the getch() we can enter only one char & this is not displayed to stout and do not wait for the enter key.

Define pointer?

Pointer is a variable which points the address of another variable

Define characteristics of arrays in C?

• An array have elements that have the same data type • Array elements are stored in subsequent memory locations • Array name represents the address of the starting element • Two-dimentional array elements are stored row by row in subsequent memory locations.

What are the different storage classes in C?

There are three types of storage classes in c automatic, static and allocated.

Define static memory allocation?

Static memory allocation: The compiler allocates the required memory space for a declared variable. By using the address of operator, the reserved address is obtained and this address may be assigned to a pointer variable.

Define dynamic memory allocation?

Dynamic memory allocation: It uses functions such as malloc( ) or calloc( ) to get memory dynamically. If these functions are used to get the memory dynamically and the values returned by these functions are assingned to the pointer variables.

Define constructor or ctor?

Constructor creates an object and initializes it. It is different from other methods in a class.

Define destructor?

Destructor erases the any extra resources allocated by the object.

Define default constructor?

Constructor with the no arguments or all the arguments has default values are called default constructor.

Define inheritance?

Inheritance allows one class to reuse the state and behavior of another class.

Define Polymorphism?

Polymorphism is allow a client of to treat different objects in the same way even if they were created from different classes and exhibit different behaviors.

Sponsered Links
Latest Updates
 
All Content of this site is for learning only. We do not warrant the correctness of its content. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright © 2014 PURVACOMPUTERS.COM All Right Reserved