answersLogoWhite

0


Best Answer

The double star (**) notation is not specific to initializing a variable in a class. It is simply a double indirect reference to an object.

float myFloat; // an object
float *myFloatPtr; // a pointer to an object
float **myFloatPtrPtr; // a pointer to a pointer to an object

myFloat = 123.456; // initialize an object
myFloatPtr = &myFloat; // initialize a pointer to an object
myFloatPtrPtr = myFloatPtr; // initialize a pointer to a pointer to an object

myFloat; // refer to an object

*myFloatPtr; // refer to an object through a pointer

**myFloatPtrPtr; // refer to an object through a pointer to a pointer

*myFloatPtrPtr; // refer to the value of the pointer to the object

Double pointer notation is used where the caller intends that one of its own pointers need to be modified by a function call, so the address of the pointer, instead of the address of the object, is passed to the function.

An example might be the use of a linked list. The caller maintains a pointer to the first node. The caller invokes functions to search, add, and remove. If those operations involve adding or deleting the first node, then the caller's pointer has to change, not the .next pointer in any of the nodes, and you need the address of the pointer to do that.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why do you use double star '' in initializing a variable in class?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What type of star is Alpha Ara?

Alpha Arae (Tchou or Choo) is the second brightest star in the constellation AraIt is a variable Be star [See related link] and has a spectral class of B3V


How do you describe a variable star?

A variable star is a star whose brightness as seen from Earth that fluctuates.


What color is the star Castor?

Castor is a variable star and also a quadruple star system, and has a spectral class of A1/A2 giving it a colour of white to white blue. See link for more information


How do you describe a variable?

A variable star is a star whose brightness as seen from Earth that fluctuates.


Is V 469 a valid variable star designation?

Yes, The first 334 variable stars in a constellation have single or double letters then they are numbered V335 upwards. For the question to make sense related to a particular star the constellation needs to be included as well.


How do you describe variable stars?

A variable star is a star whose brightness as seen from Earth that fluctuates.


When was American Association of Variable Star Observers created?

American Association of Variable Star Observers was created in 1911.


What type of star is El Nath?

Elnath is a B class giant, There is a faint star nearby (BD+28 795B) which may be a companion making Elnath part of a double star.


What is the spectral class for sirius?

Sirius is a double star. The brighter component ... the one you actually notice in the night sky ... is spectral class A1V. The faint 'secondary' component is spectral class DA2.


Is stars shining an example of s continuous variable?

No, it is a continuous process but not a continuous variable. The magnitude of star-shine, across all stars is a continuous variable. The magnitude of a star's shine over time is a continuous variable.


What type of star is Markab?

A multiple variable star, I may not be right...


A star whose brightness changes?

A star who's brightness changes is called a variable star.Examples are:AlgolPolarisBetelgeuse.See related link for more information.