All Stories
Showing posts with label C-Ques. Show all posts
Showing posts with label C-Ques. Show all posts

Tuesday, 8 October 2013

21.What are the differences between structures and union?
A structure variable contains each of the named members, and its size is large enough to hold all the members. Structure elements are of same size.

A Union contains one of the named members at a given time and is large enough to hold the largest member. Union element can be of different sizes.
22.What is the difference between arrays and pointers?
Array is collection of similar datatype. it is a static memory allocation means we can not increment and decrement the arry size once we allocated. and we can not increment the base address, reassign address.

Pointer is a dynamic memory allocation. we can allocate the size as we want, assigning into another variable and base address incrementation is allowed.
23.What is dynamic binding?
Dynamic binding (also known as late binding) means that the code associated with a given procedure call is not known until the time of the call at run time.It is associated with polymorphism and inheritance.
24.what is an abstract base class?
An abstract class is a class that is designed to be specifically used as a base class. An abstract class contains at least one pure virtual function.
25.What is the difference between class and structure?
  • By default, the members ot structures are public while that tor class is private.
  • structures doesn’t provide something like data hiding which is provided by the classes.
  • structures contains only data while class bind both data and member functions.
<<<PREV                                                                                             NEXT>>>


C Language Interview Question and Answers : 5

21.What are the differences between structures and union?
A structure variable contains each of the named members, and its size is large enough to hold all the members. Structure elements are of same size.

A Union contains one of the named members at a given time and is large enough to hold the largest member. Union element can be of different sizes.
22.What is the difference between arrays and pointers?
Array is collection of similar datatype. it is a static memory allocation means we can not increment and decrement the arry size once we allocated. and we can not increment the base address, reassign address.

Pointer is a dynamic memory allocation. we can allocate the size as we want, assigning into another variable and base address incrementation is allowed.
23.What is dynamic binding?
Dynamic binding (also known as late binding) means that the code associated with a given procedure call is not known until the time of the call at run time.It is associated with polymorphism and inheritance.
24.what is an abstract base class?
An abstract class is a class that is designed to be specifically used as a base class. An abstract class contains at least one pure virtual function.
25.What is the difference between class and structure?
  • By default, the members ot structures are public while that tor class is private.
  • structures doesn’t provide something like data hiding which is provided by the classes.
  • structures contains only data while class bind both data and member functions.
<<<PREV                                                                                             NEXT>>>


Posted at 22:35 |  by Pritam

Thursday, 19 September 2013

16.What is a macro?
Macros are the identifiers that represent statements or expressions. To associate meaningful identifiers with constants, keywords, and statements or expressions.
17.What is arrays?
Array is a variable that hold multiple elements which has the same data type.
18.What is the difference between #include‹ › and #include “ ”?
#include‹ › ----> Specifically used for built in header files.
#include “ ” ----> Specifically used for used for user defined/created n header file.
19.What are the advantages of the functions?
  • It reduces the Complexity in a program by reducing the code.
  • Function are easily understanding and reliability and execution is faster.
  • It also reduces the Time to run a program.In other way,Its directly proportional to Complexity.
  • Its easy to find-out the errors due to the blocks made as function definition outside the main function.
20.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];

<<<PREV
                                                                                         NEXT>>>

C Language Interview Question and Answers : 4

16.What is a macro?
Macros are the identifiers that represent statements or expressions. To associate meaningful identifiers with constants, keywords, and statements or expressions.
17.What is arrays?
Array is a variable that hold multiple elements which has the same data type.
18.What is the difference between #include‹ › and #include “ ”?
#include‹ › ----> Specifically used for built in header files.
#include “ ” ----> Specifically used for used for user defined/created n header file.
19.What are the advantages of the functions?
  • It reduces the Complexity in a program by reducing the code.
  • Function are easily understanding and reliability and execution is faster.
  • It also reduces the Time to run a program.In other way,Its directly proportional to Complexity.
  • Its easy to find-out the errors due to the blocks made as function definition outside the main function.
20.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];

<<<PREV
                                                                                         NEXT>>>

Posted at 21:36 |  by Pritam
11.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 the objects that have been created by a constructors.Like a constructor , the destructor is a member function whose name is the same as the class name but is precided by a tilde.
12.What is a structure?
Structure constitutes a super data type which represents several different data types in a single unit. A structure can be initialized if it is static or global.
13.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 the object, the name of the function and the information to be sent.
14.Define Constructors?
A constructor is a member function with the 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.
15.What is the use of default constructor?
A constructors that accepts no parameters is called the 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.

<<<PREV                                                                                            NEXT>>>

C Language Interview Question and Answers : 3

11.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 the objects that have been created by a constructors.Like a constructor , the destructor is a member function whose name is the same as the class name but is precided by a tilde.
12.What is a structure?
Structure constitutes a super data type which represents several different data types in a single unit. A structure can be initialized if it is static or global.
13.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 the object, the name of the function and the information to be sent.
14.Define Constructors?
A constructor is a member function with the 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.
15.What is the use of default constructor?
A constructors that accepts no parameters is called the 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.

<<<PREV                                                                                            NEXT>>>

Posted at 21:32 |  by Pritam

Sunday, 15 September 2013

6.What is “this”s pointer?
The this pointer is a pointer accessible only within the member functions of a class, struct, or union type. It points to the object for which the member function is called. Static member functions do not have a this pointer.
7.What are the uses of a pointer?
    Pointer is used in the following cases
  • It is used to access array elements.
  • It is used for dynamic memory allocation.
  • It is used in Call by reference.
  • It is used in data structures like trees, graph, linked list etc.
8.What is the purpose of main() function?
    The function main() invokes other functions within it.It is the first function to be called when the program starts execution.
  • It is the starting function.
  • It returns an int value to the environment that called the program.
  • Recursive call is allowed for main( ) also.
  • It is a user-defined function.
9.What are the different storage classes in C?
    There are four types of storage classes.
  • Automatic
  • Extern
  • Regiter
  • Static
10.Define inheritance?
Inheritance is the process by which objects of one class acquire properties of objects of another class.


<<<PREV                                                                                           NEXT>>>

C Language Interview Question and Answers : 2

6.What is “this”s pointer?
The this pointer is a pointer accessible only within the member functions of a class, struct, or union type. It points to the object for which the member function is called. Static member functions do not have a this pointer.
7.What are the uses of a pointer?
    Pointer is used in the following cases
  • It is used to access array elements.
  • It is used for dynamic memory allocation.
  • It is used in Call by reference.
  • It is used in data structures like trees, graph, linked list etc.
8.What is the purpose of main() function?
    The function main() invokes other functions within it.It is the first function to be called when the program starts execution.
  • It is the starting function.
  • It returns an int value to the environment that called the program.
  • Recursive call is allowed for main( ) also.
  • It is a user-defined function.
9.What are the different storage classes in C?
    There are four types of storage classes.
  • Automatic
  • Extern
  • Regiter
  • Static
10.Define inheritance?
Inheritance is the process by which objects of one class acquire properties of objects of another class.


<<<PREV                                                                                           NEXT>>>

Posted at 10:33 |  by Pritam
1.What is C language?
C is a programming language developed at AT & T's Bell Laboratories of USA in 1972.The C programming language is a standardized programming language developed in the early 1970s by Ken Thompson and Dennis Ritchie for use on the UNIX operating system. It has since spread to many other operating systems, and is one of the most widely used programming languages
2.What are the types of constants in c?
    C constants can ba divided into two categories :
  • Primary constants
  • Secondary constants
3.What are the types of C intructions?
    Now that we have written a few programs let us look at the instructions that we used in these programs. There are basically three types of instructions in C :
  • Type Declaration Instruction
  • Arithmetic Instruction
  • Control Instruction
4.What is a pointer?
Pointers are variables which stores the address of another variable. That variable may be a scalar (including another pointer), or an aggregate (array or structure). The pointed-to object may be part of a larger object, such as a field of a structure or an element in an array.
5.What is the difference between arrays and pointers?
Pointers are used to manipulate data using the address. Pointers use • operator to access the data pointed to by them.
Arrays is a collection of similar datatype. Array use subscripted variables to access and manipulate data. Array variables can be Equivalently written using pointer expression.


                                                                                                        NEXT>>>

C Language Interview Question and Answers : 1

1.What is C language?
C is a programming language developed at AT & T's Bell Laboratories of USA in 1972.The C programming language is a standardized programming language developed in the early 1970s by Ken Thompson and Dennis Ritchie for use on the UNIX operating system. It has since spread to many other operating systems, and is one of the most widely used programming languages
2.What are the types of constants in c?
    C constants can ba divided into two categories :
  • Primary constants
  • Secondary constants
3.What are the types of C intructions?
    Now that we have written a few programs let us look at the instructions that we used in these programs. There are basically three types of instructions in C :
  • Type Declaration Instruction
  • Arithmetic Instruction
  • Control Instruction
4.What is a pointer?
Pointers are variables which stores the address of another variable. That variable may be a scalar (including another pointer), or an aggregate (array or structure). The pointed-to object may be part of a larger object, such as a field of a structure or an element in an array.
5.What is the difference between arrays and pointers?
Pointers are used to manipulate data using the address. Pointers use • operator to access the data pointed to by them.
Arrays is a collection of similar datatype. Array use subscripted variables to access and manipulate data. Array variables can be Equivalently written using pointer expression.


                                                                                                        NEXT>>>

Posted at 10:13 |  by Pritam
© 2013 Knowledge To Grab. WP Theme-junkie converted by K-Grab
Blogger templates. Proudly Powered by Blogger.
back to top