answersLogoWhite

0

The ampersand '&' has many uses in the C++ language:

The single ampersand can be used to reference the pointer address of a pointer:

int* pointer;

int* anpointer;

anpointer = &pointer;

This example, although perhaps not valid, shows that the anpointer reference is now the same as the reference to the pointer memory address.

The single ampersand can also be used to reference an object in a function:

void function( int param1, int param2, int &reference );

If this function were to be called, and the reference object altered within the function, the actualy object that was passed into the function would be altered.

The double ampersand '&&' specifies that the left AND the right concepts must both be true before the whole statement is true. For example:

if( conceptA true )

{

conceptC = true;

}

User Avatar

Wiki User

13y ago

What else can I help you with?