Solved

couple of questions

Posted on 2004-04-10
7
158 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
Comment Utility
Sounds like homework or Interview questions.

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

Author Comment

by:gutta_naveen
Comment Utility
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
Comment Utility
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
Comment Utility


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
Comment Utility
PAQed, with points refunded (350)

Computer101
E-E Admin
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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 learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now