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

 Print  |  
Question:  Honey Well Written Test -  C++ Questions

Answer:

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



March 03, 2009 07:24:50 #3
 manihclcodc   Member Since: March 2009    Total Comments: 3 

RE: Honey Well Written Test -  C++ Questions
 
For 1st question, answer is d) compilation error

Here is the sample program describes the scenario.

#include<iostream>
using namespace std;
template<typename T>
class x
{
  public :
    static T a;
};

int main()
{
  x<int> i;
  x<int> j;
  i.a = 10;
  cout << j.a;
}


Error for this program is 

/tmp/cc78j5cy.o(.text+0x11a): In function `main':
: undefined reference to `x<int>::a'
/tmp/cc78j5cy.o(.text+0x127): In function `main':
: undefined reference to `x<int>::a'
collect2: ld returned 1 exit status

     

 

Back To Question