145k views
4 votes
When this is placed in front of a variable name, it returns the address of that variable.

A) asterisk ( * )
B) conditional operator
C) ampersand ( & )
D) semicolon ( ; )
E) None of these

1 Answer

5 votes

Final answer:

The ampersand (&) is used to return the address of a variable in programming languages like C and C++.

Step-by-step explanation:

The correct answer is C) ampersand (&).

When the ampersand (&) is placed in front of a variable name, it returns the address of that variable. This is known as the address-of operator in programming languages like C and C++. It is used to access and manipulate the memory address of a variable.

For example, if we have a variable called x and we want to get its memory address, we can use the ampersand operator like this: &x. This will give us the address of variable x.

User Ryan Sepassi
by
8.0k points