Re: printing the number of references


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]

Posted by Emerson on July 16, 2001 at 04:47:03:

In Reply to: printing the number of references posted by shawn on July 16, 2001 at 01:12:56:

: all-
: how does van wieren's test.cpp file print out the number fo references to a foo object? i mean, when it says
: cout << "Handler indicated that " << pid << " now has " << references << " references to that foo." << endl;
: how does the compiler know what value is stored in references? i see the line where
: result=test_handler_ptr->create_foo(pid, dataone, references);
: but i don't see how or where references is defined.
: thanks for any help


the "unsigned long int& references" argument for create_foo() (and also remove_foo()) is passes by reference (indicated by the &).

you're supposed to change the value for the references variable within your foohandler's create_foo() function to reflect the value you have stored...



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]