C++ Interview Questions
- 0of 0 votes
AnswersGiven a variable, how can you find whether it was allocated from stack or from heap memory???
- himanshu November 17, 2012 in India| Report Duplicate | Flag | PURGE
Adobe Member Technical Staff C C++ - 0of 0 votes
Answershow to read a character from console(output screen) in turboc in c++
- Parixit November 12, 2012 in India| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersWhat is multithreading
- jinglebells November 04, 2012 in United States| Report Duplicate | Flag | PURGE
Qualcomm Software Engineer / Developer C++ - 0of 0 votes
AnswersDifference between process and thread
- jinglebells November 04, 2012 in United States| Report Duplicate | Flag | PURGE
Qualcomm Software Engineer / Developer C++ - 0of 0 votes
AnswersWrite a program which makes use of two classes named integer and character. The class integer has one integer data
- kirti28kumar October 25, 2012 in India for codeblock
member lying in the private section and one member function named input lying in the protected section.The member
function input is used to enter the data in the data member.The class character publically inherits from the class
integer.The class character has one character data member and two member functions named calc and display.The calc
function ask the user to input data in the character data member which will be a number from 1-9.The calc function will
divide the integer number (Data member of the class integer) entered earlier with the number entered in the character
and the display function will display the message “Divides Completely” in the case the integer is divided completet and
the message “Does not divide” otherwise.The ASCII values of numbers 0-9 range from 48-57.Eg. run is as follows:
Enter Integer:10
Enter Character :2
Result: Divides completely.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer C++ - -1of 1 vote
AnswersWrite a program which contains a class named String (please take care of the case). The class should be capable of
- kirti28kumar October 25, 2012 in India for codeblock
holding a string containing more than one word. The class should at least have a parametric constructors by which we
are going to supply a sentence at run time. Class string should be defined in this way that the following statement
should be executed with their proper output.
String str1; //string with length 0
String str2;
cin>>str2; // to print the char elements of str2;
(Don’t use any string library function for the any purpose)
You are free to add any C++ concepts, any other data members, member functions and constructors you think are
necessary to solve the problem.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer C++ - 0of 0 votes
AnswersWhat the real problem could happen because of memory leak?? I have an adequate chunks of memory and I really don't bother how much memory wasted. Here what problem a memory leak can cause??
- Alex October 16, 2012 in United States| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersWrite a menu driven C++ program to display area of circle, rectangle, and triangle
- Lavina October 12, 2012 in United States
using function overloading. (overload area function)
Function Overloading
1. Area of Circle
2. Area of Rectangle
3. Area of Triangle
4. Exit
Enter Your Choice: 2
Enter the Sides of the Rectangle: 5 5
Area of Rectangle is: 25
1. Area of Circle
2. Area of Rectangle
3. Area of Triangle
4. Exit
Enter Your Choice: 4| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersHow would the Destructor for Singleton look like ?
- BJ October 09, 2012 in India
dbx and how to debug a multi threaded application
Use of virtual destructor
Practical usage of STL set.| Report Duplicate | Flag | PURGE
Yahoo C++ - 0of 0 votes
Answers#include <iostream>
- anuj.iiit2007 October 02, 2012 in United States
class C {
private:
int num;
public:
C(int a) : num(a) {}
int get_val() const;
};
//changes are not allowed in below code
int C::get_val() const {
num++;
return num;
}
int main() {
C obj(29);
std::cout << obj.get_val() << std::endl;
}
The question was to make the above code work you can make changes only inside class C| Report Duplicate | Flag | PURGE
Microsoft C++ - 0of 0 votes
AnswersDesign Solar System
- R@M3$H.N October 01, 2012 in India for ISL| Report Duplicate | Flag | PURGE
IBM Software Engineer / Developer C++ Application / UI Design - 0of 0 votes
AnswersIf we have given a data type, how can we find the precision value for this........need just an algo....
- praveen303 September 28, 2012 in India| Report Duplicate | Flag | PURGE
HCL Developer Program Engineer Algorithm C++ - 0of 0 votes
Answershow would you print the lever order of a tree (not a binary tree i.e. each node has more than two children)?
- MobileEdge September 27, 2012 in United States| Report Duplicate | Flag | PURGE
Algorithm C++ Coding Data Structures - 0of 0 votes
Answersclass base{}
- gs September 23, 2012 in United States
class derived {}
main()
{
base b;
derived *d=dynamic_casr<base>&b;
}
it gives compiler error - because above inheritance is not polymorphic.
any reason why dynamic_cast, instead of returning 0 looks for polymorphic structure ?| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswerWho initializes 'this' pointer ?
- gs September 23, 2012 in United States
is it initialized before constructor call?| Report Duplicate | Flag | PURGE
C++ - 1of 1 vote
AnswersHow to store a 100+ digit no. in a variable?
- pulkit.2810 September 20, 2012 in India| Report Duplicate | Flag | PURGE
C C++ - 0of 0 votes
Answerswhat are the disadvantage or problem in template instantiation?
- Alex September 16, 2012 in United States| Report Duplicate | Flag | PURGE
Oracle C++ - 0of 0 votes
Answerswhy vector does not push_front ?
- BJ September 14, 2012 in India| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersIn dynamic polymorphism,binding happens at run time.But virtual table is created and virtual pointer is initialized during compile time.when is the virtual table filled with the appropriate function addresses?
- TeachLead September 08, 2012 in India| Report Duplicate | Flag | PURGE
PRDS Systems Design Engineer C++ - 0of 0 votes
Answers3. What is size of the object created for this class in a 4-byte alignment, 32-bit system.?
- guest August 29, 2012 in United StatesClass A { Public: A(); Virtual ~A(); Int a; Char b; Int c; }
| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
Answersoutput and why ?
- pramod August 26, 2012 in India for c++#include<iostream> class con { struct node { int data; int rest; }; public: con() {} }; int main() { con c; std::cout<<"size of con class ="<<sizeof(c); return 0; }
| Report Duplicate | Flag | PURGE
Adobe Software Engineer / Developer C++ - 0of 0 votes
Answershow many times the base class are called in the following code.
- shanelinnz August 14, 2012 in United Statesclass Base { } class D1:public Base { } class D2:virtual public Base { } class DD: public D1, public D2 { } int main() { DD cObj; }
| Report Duplicate | Flag | PURGE
Developer Program Engineer C++ - 0of 0 votes
Answerswrite the function called and its definition body when a new is used??
- Alex August 13, 2012 in United States| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
Answershow will I acess the virtual methods with help of reference?? I dont have to use pointers..
- Alex August 05, 2012 in United States| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersWhat default method a empty class holds??
- Alex August 05, 2012 in -
Empty calss in the sense class does not have any data members and methods..| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
Answershow map is implemented? how insert and delete works?
- Sach July 24, 2012 in India| Report Duplicate | Flag | PURGE
Igate Technical Architect C++ Data Structures - 0of 0 votes
AnswersCan we use "char *" in map as a key?(note that he is not asking stl::string )
- Sach July 24, 2012 in India| Report Duplicate | Flag | PURGE
Igate Technical Architect C++