It declares a pointer to a char pointer.

The usage of such a pointer would be to do such things like:

void setCharPointerToX(char ** character) {
   *character = "x"; //using the dereference operator (*) to get the value that character points to (in this case a char pointer
}
char *y;
setCharPointerToX(&y); //using the address-of (&) operator here
printf("%s", y); //x

Here's another example:

char *original = "awesomeness";
char **pointer_to_original = &original;
(*pointer_to_original) = "is awesome";
printf("%s", original); //is awesome

Use of ** with arrays:

char** array = malloc(sizeof(*array) * 2); //2 elements

(*array) = "Hey"; //equivalent to array[0]
*(array + 1) = "There";  //array[1]

printf("%s", array[1]); //outputs There

The [] operator on arrays does essentially pointer arithmetic on the front pointer, so, the way array[1] would be evaluated is as follows:

array[1] == *(array + 1);

This is one of the reasons why array indices start from 0, because:

array[0] == *(array + 0) == *(array);
Answer from Jacob Relkin on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › c language › operators-in-c
Operators in C - GeeksforGeeks
Example: Increment( ++ ) , Decrement( -- ) Binary Operators: Operators that work on two operands. Example: Addition ( + ), Subtraction( - ) , Multiplication ( * ) Ternary Operators: Operators that work on three operands. Example: Conditional ...
Published   November 1, 2025
Top answer
1 of 5
57

It declares a pointer to a char pointer.

The usage of such a pointer would be to do such things like:

void setCharPointerToX(char ** character) {
   *character = "x"; //using the dereference operator (*) to get the value that character points to (in this case a char pointer
}
char *y;
setCharPointerToX(&y); //using the address-of (&) operator here
printf("%s", y); //x

Here's another example:

char *original = "awesomeness";
char **pointer_to_original = &original;
(*pointer_to_original) = "is awesome";
printf("%s", original); //is awesome

Use of ** with arrays:

char** array = malloc(sizeof(*array) * 2); //2 elements

(*array) = "Hey"; //equivalent to array[0]
*(array + 1) = "There";  //array[1]

printf("%s", array[1]); //outputs There

The [] operator on arrays does essentially pointer arithmetic on the front pointer, so, the way array[1] would be evaluated is as follows:

array[1] == *(array + 1);

This is one of the reasons why array indices start from 0, because:

array[0] == *(array + 0) == *(array);
2 of 5
51

C and C++ allows the use of pointers that point to pointers (say that five times fast). Take a look at the following code:

char a;
char *b;
char **c;

a = 'Z';
b = &a; // read as "address of a"
c = &b; // read as "address of b"

The variable a holds a character. The variable b points to a location in memory that contains a character. The variable c points to a location in memory that contains a pointer that points to a location in memory that contains a character.

Suppose that the variable a stores its data at address 1000 (BEWARE: example memory locations are totally made up). Suppose that the variable b stores its data at address 2000, and that the variable c stores its data at address 3000. Given all of this, we have the following memory layout:

MEMORY LOCATION 1000 (variable a): 'Z'
MEMORY LOCATION 2000 (variable b): 1000 <--- points to memory location 1000
MEMORY LOCATION 3000 (variable c): 2000 <--- points to memory location 2000
Discussions

Could someone explain the use of the asterisk * in C and how it is used?
Is it just that it means different things depending on how it is used Yes. Just like it can also mean multiplication. int* a = malloc(5 * sizeof(*a)); ^ ^ ^ Dereferencing "Pointer to" Multiplication More on reddit.com
🌐 r/C_Programming
18
10
April 26, 2022
what does "|=" operator mean in C? - Stack Overflow
How does this code work: int a = 1; int b = 10; a |= b; how the a |= b; works? Seems like |= is not an operator in C? More on stackoverflow.com
🌐 stackoverflow.com
What does the |= operator mean in C++? - Stack Overflow
you can write x |= y to mean x = x | y, which ORs together all the bits of x and y and then places the result in x. Beware that it can be overloaded, but for basic types you should be ok :-) ... Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... New site design and philosophy for Stack Overflow: Starting February 24, 2026... ... What do the temperatures in a VLE-diagram represent and does ... More on stackoverflow.com
🌐 stackoverflow.com
syntax - What is the meaning of '==' in C? - Stack Overflow
Can human wills and structural limits prevent philosophical truths from taking hold like in math or logic? Are "I gave my friend the bear as a gift" and "I gifted my friend the bear" the same? ... Do we need the Second Law of Thermodynamics to give physical meaning to the quantities appearing in the First Law? ... How does ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
W3Schools
w3schools.com › c › c_operators.php
C Operators
int sum1 = 100 + 50; // 150 (100 + 50) int sum2 = sum1 + 250; // 400 (150 + 250) int sum3 = sum2 + sum2; // 800 (400 + 400) Try it Yourself » · C divides the operators into the following groups:
🌐
YouTube
youtube.com › watch
What the * (asterisk, splat, star) Means In C Programming - YouTube
The * character (asterisk, star, or splat) is used in different ways in C. This video walks through 3 of those ways0:13 - What do we call the * and what doe...
Published   September 9, 2022
🌐
Reddit
reddit.com › r/c_programming › could someone explain the use of the asterisk * in c and how it is used?
r/C_Programming on Reddit: Could someone explain the use of the asterisk * in C and how it is used?
April 26, 2022 -

I am currently working on an assignment in C where we are required to make a stack by simply using pointers.

I know the line: int *ptr = &val; declares ptr to be a "pointer to"(which is my interpretation of what asterisk * means in C) the "address of" the integer variable val.

When I want to create a double pointer, or a pointer to a pointer, I do so like:

int **ptr_ptr = &ptr; By setting ptr_ptr to a "pointer to" the address of pointer ptr.

When we use the asterisk anywhere other than in a declaration, it is usually referred to as dereferencing that pointer (I think), and grabbing the value that the pointer actually points to. This goes against my intuition that an asterisk means "pointer to".

Could anybody explain the proper meaning of the asterisk in C? Is it just that it means different things depending on how it is used (i.e. in a declaration versus anywhere else)?

Thanks!

🌐
Programiz
programiz.com › c-programming › c-operators
Operators in C
April 27, 2022 - C programming has two operators increment ++ and decrement -- to change the value of an operand (constant or variable) by 1. Increment ++ increases the value by 1 whereas decrement -- decreases the value by 1. These two operators are unary operators, meaning they only operate on a single operand.
🌐
Quora
quora.com › What-is-the-use-of-double-asterisk-before-an-integer-variable-name-in-C-programming
What is the use of double asterisk (* *) before an integer variable name in C programming? - Quora
Answer (1 of 2): If you define a variable, say p, as int **p, you are not declaring an integer but a pointer to one or more integer pointers. Although you may declare it with or without spaces between the asterisks, it’s easier to understand ...
Find elsewhere
🌐
Wikipedia
en.wikipedia.org › wiki › Operators_in_C_and_C++
Operators in C and C++ - Wikipedia
3 weeks ago - This is a list of operators in the C and C++ programming languages. All listed operators are in C++ and lacking indication otherwise, in C as well. Some tables include a "In C" column that indicates whether an operator is also in C. Note that C does not support operator overloading.
🌐
TutorialsPoint
tutorialspoint.com › home › cprogramming › c operators
C Operators
June 10, 2012 - Depending on how many operands are required to perform the operation, operands are called as unary, binary or ternary operators. They need one, two or three operands respectively. Unary operators − ++ (increment), -- (decrement), !
🌐
IDTech
idtech.com › blog › what-does-asterisk-mean-in-c-programming
What Does * (Asterisk) Mean in C++ Programming? | CPP Meaning & Usage
You can think of it as a variable for another variable's address. To declare a pointer, use an asterisk (*). Below where input is declared, type: string* pointer;
🌐
GeeksforGeeks
geeksforgeeks.org › c language › c-pointers
Pointers in C - GeeksforGeeks
A pointer is a variable that stores the memory address of another variable. Instead of holding a direct value, it holds the address where the value is stored in memory. It is the backbone of low-level memory manipulation in C.
Published   November 14, 2025
Top answer
1 of 3
28

These operators were borrowed from C into many other languages. C inherited & and | from B, where they’re used for bitwise operations by default, or for logical operations when a truth value is expected. For example, to quote “Users’ Reference to B on MH-TSS”, §12.0:

The use of the operator & in conditional statements has been optimized to allow for conditional transfers and much more efficient object code; unfortunately, there is a conflict between this use and the use of this operator in its more usual sense as a bitwise logical operator. Thus, the statement:

if( a&077 )goto label;

is ambiguous; on the one hand, it could mean “if the last two octal digits of a are not 00, go to label” (& used as a bitwise operator), while on the other hand it could mean “if both a and 077 are nonzero, go to label” (& as a logical operator). This ambiguity is broken by always assuming the logical operator in a case where a truth value is expected (if, while, and conditional expression). To force the bitwise interpretation in the above example, one must write

if( (a&077) != O )goto label;

which is in fact optimized well by the code generator.

B inherited this from BCPL, for example “The BCPL Cintsys and Cintpos User Guide” ch. 2:

Expressions of the form: E1&E2 and E1|E2 return, respectively, the bitwise AND or OR of their operands unless the expression is being evaluated in a boolean context such as the condition in a while command, in which case the operands are tested from from left to right until the value of the condition is known.

In C, the operators evaluate both their operands eagerly, and && and || were added to be explicit about the laziness in the second operand. From “The Development of the C Language”, under “Neonatal C”:

Rapid changes continued after the language had been named, for example the introduction of the && and || operators. In BCPL and B, the evaluation of expressions depends on context: within if and other conditional statements that compare an expression’s value with zero, these languages place a special interpretation on the and (&) and or (|) operators. In ordinary contexts, they operate bitwise, but in the B statement

if (e1 & e2) ...

the compiler must evaluate e1 and if it is non-zero, evaluate e2, and if it too is non-zero, elaborate the statement dependent on the if. The requirement descends recursively on & and | operators within e1 and e2. The short-circuit semantics of the Boolean operators in such ‘truth-value’ context seemed desirable, but the overloading of the operators was difficult to explain and use. At the suggestion of Alan Snyder, I introduced the && and || operators to make the mechanism more explicit. Their tardy introduction explains an infelicity of C’s precedence rules. In B one writes

if (a==b & c) ...

to check whether a equals b and c is non-zero; in such a conditional expression it is better that & have lower precedence than ==. In converting from B to C, one wants to replace & by && in such a statement; to make the conversion less painful, we decided to keep the precedence of the & operator the same relative to ==, and merely split the precedence of && slightly from &. Today, it seems that it would have been preferable to move the relative precedences of & and ==, and thereby simplify a common C idiom: to test a masked value against another value, one must write

if ((a&mask) == b) ...

where the inner parentheses are required but easily forgotten.

Using a vertical bar for logical “OR” was already well established before BCPL (1967), notably in PL/I (1964); as a bit of trivia, this is why the ASCII character is styled as a solid line, rather than a broken line as it was originally.

An initial draft for a 7-bit character set that was published by the X3.2 subcommittee for Coded Character Sets and Data Format on June 8, 1961 […] received opposition from the IBM user group SHARE, with its chairman, H. W. Nelson, writing a letter to the American Standards Association titled “The Proposed revised American Standard Code for Information Interchange does NOT meet the needs of computer programmers!”; in this letter, he argues that no characters within the international subset designated at columns 2-5 of the character set would be able to adequately represent logical OR and logical NOT in languages such as IBM’s PL/I universally on all platforms.

I’m not sure if PL/I was the first mainstream language to use this character with this meaning, but in any case, many of its predecessors (Algol, COBOL, and Fortran) did not.

2 of 3
19

In a comment, Michael Homer mentioned that | was used for "or" as metalanguage in the Algol 60 report. The Algol 60 report is from 1960, earlier than PL/I (1964) mentioned in Jon Purdy's comprehensive answer. The | symbol for "or" in this report is part of Backus-Naur form (which was first used in the Algol 60 report). Backus originally used the word "or" with a bar over it, and Naur is the one to change this notation to |. So Naur appears to be the originator of | for "or."

Naur's choice may have been influenced by the Sheffer stroke which Sheffer in 1913 used as a symbol for NOR, and which was later (1917) misinterpreted and became widely used, as it is today, as a symbol for NAND. The second edition of Principia Mathematica (1927) helped popularize this usage of | for NAND.

🌐
freeCodeCamp
freecodecamp.org › news › pointers-in-c-programming
How to Use Pointers in C Programming
May 3, 2023 - Once we have a pointer that points to a specific memory location, we can access or modify the value stored at that location by dereferencing the pointer. To dereference a pointer, we use the asterisk * symbol again, but this time in front of ...
🌐
freeCodeCamp
freecodecamp.org › news › c-operator-logic-operators-in-c-programming
C Operator – Logic Operators in C Programming
March 8, 2023 - Arithmetic operators such as the increment operator(++), which increments the value of the operand by 1. And the decrement operator(--), which decrements the value of the operand by 1. Logical operators like the NOT(!) operator.
🌐
YouTube
youtube.com › watch
C++ Pointers to Pointers - Finally Understand Double Pointers - YouTube
Start your software dev career - https://calcur.tech/dev-fundamentals Pointers are complicated, but what about a pointer to a pointer? This can be confusing,...
Published   April 27, 2023