GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Placement Papers  >  Honey Well  >  C Plus Plus
 C Plus Plus  |  Question 1 of 1    Print  
Honey Well Written Test -  C++ Questions

1)  If there is one class template which has one static member variable
     that static variable will belong to
     a) Every instance of class template will share the same copy of static
variable
     b) Every instance of class template will have its own copy of  static
variable.
     c) Compilation error
     d) Don't remember.
2) What is template specialization ???

    a)  define a new template class for a specific data type.
     b)c)d)
3)  How we will overload operator  *+=    such that
      obj1 *+= obj2;
      implies that
     obj1=obj1*(obj1+obj2);
      four choice were there last option was d) it is not possible I checked
that option.
4)  IN C++ what does the operator overloading means.
      a) Giving new meaning to existing C++ operators
      b) defining functionality of existing  C++ operator for user define
objects.
      c)  defining new operators.
      d) don't remember.
5)  what is '>>' in C++
     a) right shift operator and insertion   operator depend upon the use
     b) right shift operator and extraction  operator depend upon the
context use
     c) right shift operator and insertion/extraction  operator depend upon
the use
6)   class A
      {
       int a ,b;
       A() : a(0)
       {b=0;}
      };
     if you create obj of this class as A obj;
    a) b will be initialized before a
    b) a will be initialized before b
    c) both will be initialized together
    d) none of these.

    a) exec

How image of one process can be copied to new born process
     a) fork

how can you list all the files used by a particular process how do u create a link of file




  
Total Answers and Comments: 1 Last Update: March 06, 2008   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
March 06, 2008 06:32:02   #1  
kishore2eee_svu Member Since: December 2007   Contribution: 1    

RE: Honey Well Written Test -  C++ Questions

1) If there is one class template which has one static member variable that static variable will belong to

Answer : a) Every instance of class template will share the same copy of static variable. 
Every class instantiated from a template class is like a ordinary and separate class. So by definition of static member variable, every such class should have its own copy of static variable so answer is a .


2) What is template specialization ?

Answer : Template specialization is a way of informing the compiler to use that version of the template for specific data types in case of template class and for specific arguments in case of function template.
For e.g say we define template class as
template class container{}
So a particular container class will be generated depending on the template argument which is T


container d;

the above statement will generate container class from the template class.

If we prefer to optimize the implementation by making all containers of pointers share a common implementation, we could specialize the above template for pointer template argument as below


template class container{}
In this all the below statements generate classes out of the specialized template class
container
container

This is called template specialization.

3)How we will overload operator*+=such that
obj1 *+= obj2;
implies that
obj1=obj1*(obj1+obj2);
four choice were there last option was d) it is not possible I checked that option.


Answer : Its not possible to define new operator using operator overloading, only existing operators can be overloaded. There is no such ternary operator as *+= in C++, so its not possible to overload that operator.

4)IN C++ what does the operator overloading means.
a) Giving new meaning to existing C++ operators
b) defining functionality of existingC++ operator for user define
objects.
c)defining new operators.
d) don't remember.


Answer : b. operator overloading doesn't allow changing the meaning of existing operators, also we can't change the meaning of the operator in case of built in data types. Only operations involving user defined data types can be overloaded.

5)
What is '>>' in C++
a) right shift operator and insertion operator depend upon the use
b) right shift operator and extractionoperator depend upon the
context use
c) right shift operator and insertion/extractionoperator depend upon
the use


Answer : In C++ operator">>" is still a right shift operator as it was in C. Howeve the operator was been overloaded in almost all of library classes as an extraction operator. So its not a built in extraction operator but still a right shift operator.

6) class A
{
int a ,b;
A() : a(0)
{b=0;}
};
if you create obj of this class as A obj;
a) b will be initialized before a
b) a will be initialized before b
c) both will be initialized together
d) none of these.


Answer : a) exec

The order of initialization is not as per the order of member initializer list rather the member variables are initialized int the order of declaration in the class. So the variable a will be initialized first followed by b. So the answer is b.


 
Is this answer useful? Yes | No

 Related Questions

1)  If there is one class template which has one static member variable     that static variable will belong to     a) Every instance of class template will 
Latest Answer : 1) If there is one class template which has one static member variable that static variable will belong to Answer : a) Every instance of class template will share the same copy of static variable.  Every class instantiated from a template class ...


 Sponsored Links

 
Related Articles

Importance of Strong Vocabulary

Why Having a Strong Vocabulary is So Important In addition to your appearance and the way you carry yourself people will judge you based on the words that come out of your mouth Even if you are a mathematical genius having a poor vocabulary will send across a message that you re not very intelligent
 

HR Interview - Most Popular HR Interview Questions With Generic Answer Formats

Most Popular HR Interview Questions With Generic Answer Formats While it is impossible to know exactly what you will be asked during a job interview there are a number of generic questions that most companies will ask you mosgoogle In this article I will present you with some questions that are comm
 

HR Interview - How To Deal With Tricky Interview Questions

How To Deal With Tricky Interview Questions During your HR interview you will be presented with a number of questions from the interviewer The way you answer these questions will play a role in whether or not you re hired While some of these questions have obvious answers others will be tricky and t
 

How Leaders Can Build A Strong Team

How Leaders Can Build A Strong Team To be a great leader you will want to build a powerful team It doesn t matter how successful you are or plan to be To succeed you must know how to assemble the best people This is important whether you are a coach general or corporate executive mosgoogle The team
 

Questions You Should Be Prepared For During A Job Interview

Questions You Should Be Prepared For During A Job Interview While the way you answer questions during a job interview will only play a small role in whether or not you are hired it is important to pay attention to them Going to a job interview can be stressful especially if it is a highly competitiv
 

ASP.NET Interview Questions

Microsoft ASP NET Interview Questions This article provides Microsoft Interview Questions covering Microsoft ASP NET questions For more Interview Questions Answers related to Microsoft click on links provided at the end of each question set mosgoogle Microsoft ASP NET Interview Questions 1 What is R
 

C# Interview Questions

Microsoft C Interview Questions This article provides Microsoft Interview Questions covering Microsoft C questions For more Interview Questions Answers related to Microsoft click on links provided at the end of each question set mosgoogle Microsoft C Interview Questions 1 What is indexer Where it i
 

C Interview Questions

C Interview Questions This article provides C Interview Questions For more Interview Questions Answers related to C click on links provided at the end of each question set mosgoogle C Interview Questions 1 A switch statement cannot includea constants as arguments b constant expression as argumentsc
 

DB2 Interview Questions

DB2 Interview Questions This article provides Mainframe Interview Questions covering db2 questions For more Interview Questions Answers related to Mainframe click on links provided at the end of each question set mosgoogle 1 Loading of DB2 Unload with packed Decimal’ data to Oracle envi
 

Siebel Interview Questions

Siebel Interview Questions This article provides Siebel Interview Questions For more Interview Questions Answers related to Siebel click on links provided at the end of each question set mosgoogle Siebel Interview Questions 1 What is foreign key table in Siebel 2 Why do you need Primary in MVG 3 Whe
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape