Interview Questions: C and C++

by Jal on December 14, 2007

Hi, welcome back. Many of you are students pursuing your careers in a computer related field. Many of you must be on the threshold of being given the tag of an engineer or bachelor or a professional. So what’s the next big thing. Well, you guessed it right. You wish to be a part of a well known firm that can raise you high and can add a value to your ongoing career improvement process. Here’s with me some assorted C / C++ questions collected by me from various sources which will help you to get that good impression on the interviewers you ever wanted on the D-Day. A little excerpt from the text file is given below to show you a glimpse of what you will get after you download the whole file.

Excerpt:
Q. What are the access privileges in C++? What is the default access level?
A. C++ has three access privileges. They are private, public and protected. The default access level assigned to members of a class is private. Private members of a class are accessible only within the class and by friends of the class. Protected members are accessible by the class itself and it’s sub-classes. Public members of a class can be accessed by any class.

Q. What is name mangling in C++?
A. When we encode the parameter types with the function/method name into a unique name is called name mangling. The vice-versa is called demangling.

Q. What is ‘this’ pointer?
A. The ‘this’ pointer is a pointer accessible only within the member functions of a class, structure, or union type. It points to the object for which the member function is called. Static member functions do not have a this pointer. When a nonstatic member function is called for an object, the address of the object is passed as a hidden argument to the function.

Download the whole text file.

Leave a Comment

Previous post:

Next post: