Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 5th, 2007, 3:24 AM   #1
amitpansuria
Newbie
 
Join Date: Aug 2007
Posts: 13
Rep Power: 0 amitpansuria is on a distinguished road
what happen when u run this code

helo one of my client give me this code and make comment on this. but i dont know whats going beyond this. code is given below
class Base {
 public:
   virtual void foo() = 0;
   virtual void bar() = 0;
 };
 
 class Der1 : public virtual Base {
 public:
   virtual void foo();
 };
 
 void Der1::foo()
 { bar(); }
 
 class Der2 : public virtual Base {
 public:
   virtual void bar();
 };
 
 class Join : public Der1, public Der2 {
 public:
   ...
 };
 
 int main()
 {
   Join* p1 = new Join();
   Der1* p2 = p1;
   Base* p3 = p1;
 
   p1->foo();
   p2->foo();
   p3->foo();
 }
plz tell me what comment i can make on this
Amit

Last edited by big_k105; Sep 5th, 2007 at 10:52 AM. Reason: added Code tags
amitpansuria is offline   Reply With Quote
Old Sep 5th, 2007, 3:36 AM   #2
rwm
Professional Programmer
 
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2 rwm is on a distinguished road
Quote:
Originally Posted by amitpansuria View Post
helo one of my client give me this code and make comment on this.Amit
You program for a living?
rwm is offline   Reply With Quote
Old Sep 5th, 2007, 4:17 AM   #3
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Twelve posts, you should know to put your code in tags by now. Reread the "How to Post a Question" sticky.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Sep 5th, 2007, 2:47 PM   #4
Seif
Hobbyist Programmer
 
Seif's Avatar
 
Join Date: Jan 2006
Location: UK
Posts: 213
Rep Power: 3 Seif is on a distinguished road
I have a crazy idea. Why don't you build and run this code sample given to you for yourself and see what it does ? :O
Seif is offline   Reply With Quote
Old Sep 5th, 2007, 3:10 PM   #5
peace_of_mind
Professional Programmer
 
peace_of_mind's Avatar
 
Join Date: Sep 2004
Location: Hell if I know most of the time
Posts: 435
Rep Power: 4 peace_of_mind is on a distinguished road
Send a message via MSN to peace_of_mind Send a message via Yahoo to peace_of_mind
You might want to give some more information on your situation. For starters, if this is your client's code, what exactly are they paying you to do? Second, how do you not know what this does? Third, what kind of "comments" are you expected to provide? You need to be whole lot clearer if you expect to get help around here.
__________________
Amateurs built the ark
Professionals built the Titanic

peace_of_mind is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EXECryptor software protection Jean5 C++ 35 Oct 10th, 2006 7:10 PM
Little help whoawhoayoyo Assembly 8 Apr 18th, 2006 7:10 PM
How to post a question nnxion C++ 10 Jun 3rd, 2005 11:53 AM
How to post a question nnxion C++ 0 Jun 3rd, 2005 8:55 AM
How to post a question nnxion C 0 Jun 3rd, 2005 8:55 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:44 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC