Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

couple of questions

Posted on 2004-04-10
7
Medium Priority
?
205 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

926 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