C Language Interview Question and Answers, c language interview question and answers for freshers
Today i would like to share more c language interview question and answers
Today i would like to share more c language interview question and answers
1. | Define destuctors? |
---|---|
A destructor is called for a class object when that object passes out of scope or is explicitly deleted.A destructors as the name implies is used to destroy objects that have been created by a constructors.Like a constructor , destructor is a member function whose name is same as the class name but is precided by a tilde. |
2. | What is structure in c? |
---|---|
Structure constitutes a super data type which represents several different data types in an single unit. A structure can be initialized if it is static or if it is global. |
3. | What is message passing? |
---|---|
An object oriented program consists of a set of objects that communicate with each other. Message passing involves specifying the name of object, name of the function and the information to be sent. |
14. | Define Constructors? |
---|---|
A constructor is a member function with same name as its class. The constructor is invoked whenever an object of its associated class is created.It is called constructor because it constructs the values of data members of the class. |
5. | What is the use of default constructor Explain? |
---|---|
A constructors that accepts no parameters is called default constructor.If no user-defined constructor exists for a class A and one is needed, the compiler implicitly declares a default parameterless constructor A::A(). This constructor is an inline public member of its class. The compiler will implicitly define A::A() when the compiler uses this constructor to create an object of type A. The constructor will have no constructor initializer and a null body. |
6. | What is a macro? |
---|---|
Macros are dentifiers that represent statements or expressions. To associate meaningful identifiers with constants, keywords, and statements or expressions. |
7. | What are arrays? |
---|---|
Array is a variable that holds multiple elements which has the same data type. |
8. | What is the difference between #include‹ › and #include “ ” Explain? |
---|---|
#include‹ › ----> Specifically used for built in header files. #include “ ” ----> Specifically used for used for user defined/created n header file. |
9. | What are the advantages of the functions ? |
---|---|
|
10. | How do declare an array? |
---|---|
We can declare an array by specify its data type, name
and the number of elements the array holds between square brackets
immediately following the array name. syntax : data_type array_name[size]; |
ConversionConversion EmoticonEmoticon