answersLogoWhite

0

The only time you should calculate it instead of storing is when you only use that attribute once. Otherwise, store it to avoid repeating calculations.

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

What is the difference between an attribute and a behavior in c plus plus?

An attribute is a class member variable while a behaviour is a class member method.


How do you call 2 or more objects in c plus plus?

It's not clear what you mean by "call 2 or more objects". Object's aren't "called", they are instantiated. Once instantiated you may "call" (invoke) the member methods associated with those objects, or invoke functions that operate upon those objects. To invoke the same member method on 2 or more objects, simply place those objects in a vector (by reference), then iterate over the vector: void f (std::vector<my_object*> objects) { for (auto foo : objects) foo->bar(); // invoke the bar method for each foo object in objects }


What are read only objects in c plus plus?

Read-only objects are those that have private immutable member variables with public accessors (getters) but no public mutators (setters). The object members are typically initialised during construction, but the member variables cannot be altered thereafter, thus they are read-only.


What is the difference between static data member and ordinary data member?

Static data is data that does not change from program load to program exit. Static data member do not apply for c. In c++, a static data member is one that is common for all instances of that class.


What may be different for all objects in a class and what remains the same in C plus plus programming?

The only things that may be different for all objects of a class are their member variables. They represent the object's data. The only things that remain the same are the static members -- they are akin to global variables, but are local to all objects of the class type.

Related Questions

What is the difference between an attribute and a behavior in c plus plus?

An attribute is a class member variable while a behaviour is a class member method.


What is wavern's attribute?

Wavern is Drago's love interest and it does not have any attribute. Members of "The White Ones" have no attributes and Wavern is also a member of this group.


What is the best attribute of the Adwords service?

Money, the chance to sell, promote and advertise the product is the best attribute, its a bargain for individuals to attack their target audience via Google with their massive member usage.


Where do you get a Members Only jacket?

Become a member for thousands of Member-only objects.


What are the Java Data Objects standards?

Member Variables


What do you call an objects in a set?

An element or member of the set.


Is there any way for a non-member to trade members objects with a member?

As of now there is no way to do what was asked.


How are the members in the linked list liked together?

Usually each member has a pointer storing the address of the next element.


Can cagr be calculate without a calculator?

Only if you are a member of Mensa


What field name is also called?

The term "field name" is often referred to as "attribute name," particularly in the context of databases and data structures. It represents a specific column or data element within a dataset, defining the type of data that can be stored. In programming, it may also be called a "property" or "member" in the context of objects or classes.


How do you calculate Days per 1000 members?

(days/member months)*12000


What is the difference between attribute and variable?

An attribute describes something. A variable is something that can take on many values. An example in statistics for an attribute could be for a set of data the diameter. The attribute of the data could be the mean is 5 and standard deviation is 1/2. This describes the data. An example of a variable in statistics for the same set of data above is the diameter reading itself. The diameter will vary and is measured for each member of the population or sample, and may be 4.9, 5.1, 4.95, 5.05, etc. The value can vary on each part.