Javatpoint Logo
Javatpoint Logo

C++ bitset to_ulong() Function

C++ bitset to_ulong() is used to convert the contents of the bitset to an unsigned long integer. It returns an unsigned long with the integer value that has the same bits set as the bitset.

Syntax

Parameter

It does not take any parameter.

Return value

It returns an Integer value with the same bit representation as the bitset object.

Example 1

Output:

11111 as an integer is : 31

Example 2

Output:

111111 as an integer is : 63
Next TopicC++ bitset



Help Others, Please Share

facebook twitter pinterest