dgfdg

Loading...
Gadget by The Blog Doctor.
Read more: http://www.blogdoctor.me/2009/01/random-rotating-post-gadget-with.html#ixzz2UMHl8Fc6

Pages

C Language Interview Question and Answers


C Language Interview Question and Answers

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.
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.