Home Interview Questions and AnswersTechnical Interview Questions and AnswersC Programming C Programming Interview Questions and Answers For Freshers Part-2

c program11.Explain the purpose of the function sprintf().
Prints the formatted output onto the character array.

12.What is the meaning of base address of the array?
The starting address of the array is called as the base address of the array.

13.When should we use the register storage specifier?
If a variable is used most frequently then it should be declared using register storage specifier, then possibly the compiler gives CPU register for its storage to speed up the look up of the variable.

14.What is a dangling pointer?

A pointer initially holding valid address, but later the held address is released or freed. Then such a pointer is called as dangling pointer.

15.What is the purpose of the keyword typedef?
It is used to alias the existing type. Also used to simplify the complex declaration of the type.

16.What is lvalue and rvalue?
The expression appearing on right side of the assignment operator is called as rvalue. Rvalue is assigned to lvalue, which appears on left side of the assignment operator. The lvalue should designate to a variable not a constant.

17.What is the difference between actual and formal parameters?
The parameters sent to the function at calling end are called as actual parameters while at the receiving of the function definition called as formal parameters.

18.Can a program be compiled without main() function?
Yes, it can be but cannot be executed, as the execution requires main() function definition.

19.What is the advantage of declaring void pointers?
When we do not know what type of the memory address the pointer variable is going to hold, then we declare a void pointer for such.

20.Where an automatic variable is stored?
Every local variable by default being an auto variable is stored in stack memory.

You may also like

Leave a Comment