home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 2674
Discussions: 186,606, Posts: 2,227,045, Members: 230,240
Free Scan: Update Your PC's Outdated Drivers to Optimize Performance
Old March 1st, 2002, 01:24 AM   Digg it!   #1 (permalink)
ILC
Senior Member
 
ILC's Avatar
 
Join Date: Oct 2001
Location: Eastern Shore
Posts: 701
Passing a class object variable to another object variable

Alright, have a project due, and would like to figure a little something extra.

I have to create a simple class that basically keeps track of billing for an electric company.

Say I have two variables of type billing declared in my driver file,
june, and july. Two of variables under each are curent_reading, and previous_reading. The default constructor sets each of those two values to 0.

Alright, lets say using function june.setCurrentReading(int value), I set june's current value. Now the question comes, for july, using the function july.setPreviousReading, I need it to equal june's current reading. How would you all go about doing this, I mean I know I could manually do it in the driver function (thats what we are expected to do at this point) but I would prefer to be able to do it in the class. Just say july.setPrevious Reading(); and have it automatically set.

Alright so does anyone understand waht im asking, or have I confused everyone?? Thanks.

ILC

ILC is offline   Reply With Quote
TechIMO.com Ads - Login or register for less ads.
How many errors does your computer have?

You no longer need to guess! This free stability scan and registry cleaner download will give you a complete diagnosis of your Windows registry, identifying errors and conflicts.

FREE instant scan


Guest, Register Free! to remove this ad and get your tech support questions answered in minutes!
Old March 1st, 2002, 02:10 AM     #2 (permalink)
The Mad Redhatter
 
storm2k's Avatar
 
Join Date: Oct 2001
Location: NJ
Posts: 3,552
Send a message via ICQ to storm2k Send a message via AIM to storm2k Send a message via MSN to storm2k Send a message via Yahoo to storm2k
just have that july function call the june one (once the june one is set by some other means)... you can do that and it shouldn't complain...

say you have an internal value reading and you could set that to the june function (juat make some way for you to input the june thing then you can do july)...

storm2k is offline   Reply With Quote
Reply


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

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Most Active Discussions
Is It Just Me? (526)
Misery Loves Company... (1849)
Why Does the MOON Grow Bigger as It.. (18)
heatsink issue (10)
New Mobo (18)
UPGRADING C/D DRIVE TO 250GB & .. (14)
SSD's, RAID, and External Backup (7)
1 internet. 1 house. 3 computer. ho.. (13)
Is This A Compatible Gaming PC? (18)
Recent Discussions
firewall (1)
C++ compiler suggestions (4)
Official World of Warcraft Thre.. (4529)
Programming question (2)
UPGRADING C/D DRIVE TO 250GB &a.. (14)
Ubuntu or Xubuntu....anyone!!? (7)
Building my first PC and need s.. (0)
PNY vs Gainward (3)
Linksys WRT54G (2)
FS: Dell 6000 laptop, modded 36.. (2)
Apple iPod touch 16 GB $200 (4)
Six 28-Disc Cross Design Black .. (4)


All times are GMT -4. The time now is 11:49 AM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28