Solved

couple of questions

Posted on 2004-04-10
7
176 Views
Last Modified: 2010-04-01
question 1)
                   What is Design Pattern and why it is important ?
question 2 )
                   What are the essential parts of Exception Handling ?
                    I know ...try ...catch....throw...can anyone name more than this

question 3)  what is the technical term used to define the class below ?
               
class CanHash
{
  public:
     virtual bool operator == (const CanHash& ) const =0; // Compare two objects.
     virtual const char* KeyG() const =0; // Return the Key field.
 };

question 4) Can you give the difference between the two , and when you need to use whcih one ?

                             char* KeyG() const;
                             const char* KeyG() ;


               
0
Comment
Question by:gutta_naveen
  • 2
  • 2
7 Comments
 
LVL 30

Expert Comment

by:Axter
ID: 10797597
Sounds like homework or Interview questions.

FYI:
It's against EE policy to do homework questions.
0
 

Author Comment

by:gutta_naveen
ID: 10833942
Hi ,

      It's very easy to ask question in a different way , that doesn't look like a Home Work Or Interview . In that case you might have ended up in answering my questions if you knew the answers. Only difference was .... i was straight unlike other's.

  Let me come to point..... i work in a corporate company...and the questions i have asked was neither Interview nor HomeWork. You are correct upto some point..... those are the questions asked in one of the exam written by my room-mate in his online courses. And the exam is also over and we were going thru question paper and were not able to figure some of the above which i asked here. One more point ...those are not an easy questions to answer.

thanks
0
 
LVL 30

Expert Comment

by:Axter
ID: 10835706
FYI:
I notice you're grading record:
B A B B
Please check out the EE grade guide lines.

>>What are the essential parts of Exception Handling ?
>> I know ...try ...catch....throw...can anyone name more than this
There's also catch all, which is catch(...)

>>what is the technical term used to define the class below ?
It's an abstract class, because of he pure virtual function.

>>Can you give the difference between the two , and when you need to use whcih one ?

//Returns a non-constant pointer and,
char* KeyG() const;// Can not modify member variables and can not call a member function that is not const

const char* KeyG() ;//Can modify member variables, but returns a constant pointer

0
 

Author Comment

by:gutta_naveen
ID: 10890760


const char* KeyG() ;//Can modify member variables, but returns a constant pointer

--->> one more point i came to know in this case is that..."const" can be used before the function only when the return type is a * or an & type . And you can store in a non-constant pointer variable.

 *  ) in pointer case , you can not change any of them
 &  ) in reference case , it gives only read access and not write

-------------------------------------------------

 could anyone tell me what is design pattern is all about.........

thanks

 
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 11135249
PAQed, with points refunded (350)

Computer101
E-E Admin
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question