Skip to main content

Special Operators in C

2 min read Updated June 30, 2026
Share:
On this page (14sections)

Special Operators

  • The Comma Operator
  • Type cast Operator
  • Reference operator or Address Operater (”&”)
  • Dereference operator (”*”) or Pointer Operater
  • Double Pointer operator (”**”)
  • sizeof operator

The Comma Operator

  • The Comma operator can be used to link the related expressions together.

Example For Comma Operator

Comma Operator In for Loops
for(i=0,j=1;i>10:i++,j++)

Comma Operator In while Loops

While(c<10,c--)

Type cast Operator

Syntax:

( type )

Explanation

  • converts a to the specified type.
  • Note that the use of a parenthesized type in a method declaration or definition is not an example of the use of the type cast operator.

Example For Type Cast Operator

float s= 12.5;    int a;
a = (int) s;
now a value is 12.

Reference operator or Address Operater (”&”)

The reference operator noted by ampersand (”&”), is also a unary operator in c languages that uses for assign address of the variables. It returns the pointer address of the variable. This is called “referencing” operater.

Syntax

data_type x;
data_type *pt;
pt = &x

Example : Reference operator (”&”) and Dereference operator (”*“)

Dereference operator (”*”) or Pointer Operater

The dereference operator or indirection operator, noted by asterisk (”*”), is also a unary operator in c languages that uses for pointer variables. It operates on a pointer variable, and returns l-value equivalent to the value at the pointer address. This is called “dereferencing” the pointer.

data_type *pt;

Example : Reference operator (”&”) and Dereference operator (”*“)

Double Pointer operator (”**”)

Double Pointer is, that double pointer points to another pointer variable address.

data_type **pt;

sizeof operator

sizeof returns the size of a variable or datatype

sizeof (data_type)

Example :Pointer and Sizeof Usage

Continue learning with these related tutorials and programs:

Frequently Asked Questions

What does this C program do?
It is a C example program that demonstrates Special Operators, including the complete source code and the expected sample output.
How do I compile and run this C program?
Save the code in a `.c` file, compile it with `gcc filename.c -o program`, then run it with `./program` (or `program.exe` on Windows).
What concepts does this example use?
This example uses loops to iterate over data, illustrating a common pattern in C programming.

Related Tutorials

Search tutorials