Blogroll

Showing posts with label C. Questions for Campus Placement Preparation - 1. Show all posts
Showing posts with label C. Questions for Campus Placement Preparation - 1. Show all posts

C Questions for Campus Placement Preparation - 1

Saturday 26 May 2012

Question: What is static variable?
Years. Static variable is a variable That HAS visibility of a local variable and life time of an external variable. It Is Stored in main memory and HAS default value zero.

Question: Where are the auto variables Stored?
Years: Auto variables are Stored in main memory and Their default value is a garbage value.

Question: Where does global, static, local, register variables and C Program instructions get Stored?
Years: Global, static, local: Hand In memory

        
Register variable: In registers

        
C program: In hand memory.

Question: Why Preincrement operator is faster Than Postincrement?
Years: Evaluation of Any term is from left to right. Preincrement is faster Because It Does not Need to save the current value for next instruction saves Whereas Postincrement Needs to current value incremented To Be After execution of current instruction.

Question: In header files whether functions are Declared or defined?
Years: Functions are Declared in header file.

Question: Difference between arrays and linked list?
Years: Major Differences Between arrays and linked lists are:
 (i) In consecutive Elements are Stored Array in consecutive memory locations in linked list Whereas it not so.
 (Ii) In address of next array element is consecutive and Whereas in linked list it is specified in the hand of Each node address. 
(Iii) Linked List Makes better use of memory arrays Than. 
(Iv) Insertion or deletion of An element in array is difficulty inserting Than gold deletion in linked list.

Question: What is the use of typedef?

 
Years: Major uses of typedef are:
(I) It Increases the portability.
(Ii) It simplify the complex statement and Improve readability of the program.

Question: What Are The Differences Between malloc () and calloc ()?
Ans: A malloc () function allocates a block of memory of the specified size and returns a pointer of data type specified Whereas a calloc () function allocates space for a year array of elements, initializes to zero and then em returns a pointer to the memory.

Question: What are the advantages of using pointers in a program?

 
Years: Major advantages of pointers are:
(I) It allows management of structures Which are Dynamically Allocated Memory.
(Ii) It allows passing of arrays and strings to functions more Efficiently.
(Iii) Makes It can pass to address INSTEAD of structure to the structure of entire functions.
(Iv) Makes It can return to more Than one value from the function.

Question: What do the 'c' and 'v' in argc and argv stand for?

 
Ans: c stands for counter and v stands for vector.

Question: Is function declarations are Used only for compilation and not get Stored in the. EXE File?
Ans: Yes

Question: Are the variables argc and argv are local to main?
Ans: Yes
 

Most Reading

Tags

Sidebar One