TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ROGER SCUDDER
from: PHIL OHL
date: 1998-04-05 12:54:00
subject: Pointer

-> PO> void admin::raise(employee *luckyperson)
-> PO> {
-> PO>     luckyperson->salary *= 1.75;
-> PO> }
->
-> PO> and I call the function in main.
->
-> PO> admin1 raise(employee1);
->
-> PO> this code however does not seem to work.  Help!
->
-> It would have helped if you had given more info about the data.
->
-> you have a class named admin which contains a method names raise,
-> correct?
->
-> What I'm not clear about it the object employee.  What is it?
NO there is a CLASS employee and the object is employee1.  The employee
class looks somehing like:
class employee
{
char name[20];
int age;
float salary;
employee (char, int, float);  /*constructor*/
void print_employee();  /*print function*/
};
all admin does to employee is up his salary.
-> Thank you that is easy enough for even me to comment on.  I'm
-> pretty green with C++ too. :^)
"It's not easy being green." (Curmit the Frog)  :)
Phil
--- ViaMAIL!/WC4 v1.30 
---------------
* Origin: A Mind Forever Voyaging * (806)794-3778 * Lubbock,TX (1:3804/180)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.