Lost Password?

Go Back   CodeCall Programming Forum > Software Development > C and C++

Vote on your favorite hash algorithm here!

C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-11-2008, 07:07 AM
rossen rossen is offline
Newbie
 
Join Date: Jun 2008
Posts: 4
Credits: 0
Rep Power: 0
rossen is on a distinguished road
Default C++ Inheritance help!?

can anyone make a C++ program with the use of inheritance?

and with the use of this formula:

P=I/T

thanks,
-----------------------------------------
Girly Myspace Layouts become a vegetarian
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 06-11-2008, 08:19 AM
v0id's Avatar   
v0id v0id is offline
Super Moderator
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,578
Last Blog:
CherryPy(thon)
Credits: 55
Rep Power: 28
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default Re: C++ Inheritance help!?

A very simple example, showing how "Derived" inherits the functionality from "Base".
Code:
#include <iostream>

class Base
{
    public:
        void basefunction() { std::cout << "In Base" << std::endl; }
};

class Derived : public Base
{
    public:
        void derivedfunction() { std::cout << "In Derived" << std::endl; }
};

int main()
{
    Base b;
    Derived d;
    
    b.basefunction();
    d.basefunction();
    d.derivedfunction();
        
    return 0;
}
I don't know what you mean by that formula, could you be more specific?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-11-2008, 08:48 AM
Turk4n's Avatar   
Turk4n Turk4n is offline
Programming Professional
 
Join Date: May 2008
Location: ?
Age: 19
Posts: 233
Credits: 141
Rep Power: 6
Turk4n is a jewel in the roughTurk4n is a jewel in the roughTurk4n is a jewel in the roughTurk4n is a jewel in the rough
Send a message via MSN to Turk4n Send a message via Skype™ to Turk4n
Default Re: C++ Inheritance help!?

Quote:
Originally Posted by v0id View Post
A very simple example, showing how "Derived" inherits the functionality from "Base".
Code:
#include <iostream>

class Base
{
    public:
        void basefunction() { std::cout << "In Base" << std::endl; }
};

class Derived : public Base
{
    public:
        void derivedfunction() { std::cout << "In Derived" << std::endl; }
};

int main()
{
    Base b;
    Derived d;
    
    b.basefunction();
    d.basefunction();
    d.derivedfunction();
        
    return 0;
}
I don't know what you mean by that formula, could you be more specific?
I think he meant, a formula, P must be effect and I ampere and T is for time. Thats my guess, which would be likely he wants to enter two numbers and divide them. As I see your small code, its good and will work if he could work on the rest with it
__________________
Think, feel, know programming.!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-11-2008, 09:00 AM
v0id's Avatar   
v0id v0id is offline
Super Moderator
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,578
Last Blog:
CherryPy(thon)
Credits: 55
Rep Power: 28
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default Re: C++ Inheritance help!?

He can easily implement a member function:
Code:
int CalculateP(int I, int T)
{
    return I/T;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-11-2008, 09:07 AM
Turk4n's Avatar   
Turk4n Turk4n is offline
Programming Professional
 
Join Date: May 2008
Location: ?
Age: 19
Posts: 233
Credits: 141
Rep Power: 6
Turk4n is a jewel in the roughTurk4n is a jewel in the roughTurk4n is a jewel in the roughTurk4n is a jewel in the rough
Send a message via MSN to Turk4n Send a message via Skype™ to Turk4n
Default Re: C++ Inheritance help!?

Quote:
Originally Posted by v0id View Post
He can easily implement a member function:
Code:
int CalculateP(int I, int T)
{
    return I/T;
}

Wonderful, now he should be able to do the rest I guess xD
__________________
Think, feel, know programming.!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 06-11-2008, 11:19 AM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 7,707
Last Blog:
Web slideshow in JavaS...
Credits: 1,455
Rep Power: 62
Xav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to behold
Send a message via MSN to Xav
Default Re: C++ Inheritance help!?

What's this doing in the C# forum?
__________________
[TRUTH] TcM is the best moderator ever! [/TRUTH]
"Valid XHTML is like sex - everybody claims to have the same goal, but everybody has their own tricks and results vary wildly."
Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 06-11-2008, 11:58 AM
v0id's Avatar   
v0id v0id is offline
Super Moderator
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,578
Last Blog:
CherryPy(thon)
Credits: 55
Rep Power: 28
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default Re: C++ Inheritance help!?

Wow, I didn't even notice that.

It has been fixed now. Thank you for letting us know.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 06-11-2008, 12:18 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 7,707
Last Blog:
Web slideshow in JavaS...
Credits: 1,455
Rep Power: 62
Xav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to behold
Send a message via MSN to Xav
Default Re: C++ Inheritance help!?

Welcome.
__________________
[TRUTH] TcM is the best moderator ever! [/TRUTH]
"Valid XHTML is like sex - everybody claims to have the same goal, but everybody has their own tricks and results vary wildly."
Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Questions about Class inheritance njr1489 C# Programming 1 03-31-2008 11:47 AM


All times are GMT -5. The time now is 09:47 PM.

Contest Stats

Xav ........ 1455.48
MeTh0Dz|Reb0rn ........ 1089.45
WingedPanther ........ 977.76
marwex89 ........ 962.9
John ........ 914.37
morefood2001 ........ 911.18
Brandon W ........ 823.79
chili5 ........ 312.39
Steve.L ........ 276.28
dcs ........ 253.49

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 84%

Ads