What is the standard way to name a temp variable in the local function? let me give you an illustration of what I am doing. I get a pointer to a structure, so I want store one o
For your information: Code Complete has a chapter decicated to variable naming.
In your example one problem is that the member variable in Foo is not very descriptive to start with, which makes it hard to find a useful name for the placeholder local variable.
For example, I would do something like this:
struct Foo
{
double mValue; // I don't use underscores here
// however, you can do as you please.
// Also 'mValue' is just for the sake of example,
// you should find a more descriptive name :D
};
void function (Foo* f)
{
double oldValue = f->mValue;
/***Other stuff***/
f->mValue = oldValue;
}