05 - What is Wrapping | The 'unsigned' keyword in C++ (Hindi/Urdu)

Unsigned Keyword & Wrapping in C++

In this video, we are going to see what wrapping means. Then we will see what unsigned keyword means in C++ and why do we use it.

Series playlist ▶︎ https://youtube.com/playlist?list=PLt4rWC_3rBbWnDrIv4IeC4Vm7PN1wvrNg 

Source Code:

#include <iostream>
using namespace std;

int main(){
    short num = -2;
    cout<< num << endl;

    return 0;
}

/*
                    --------------------------------------------
                    ------- UNSIGNED INTEGRAL DATA TYPES -------
                    --------------------------------------------

    Type                 Number of Bytes  Minimum Value Maximum Value
    ----                 ---------------  ------------- --------------
    unsigned char        1                0             255
    unsigned short       2                0             65,535
    unsigned int         4                0             4,294,967,295
    unsigned long        4                0             4,294,967,295
    unsigned long long   8                0             18,446,744,073,709,551,615

    */

Watch The Video:

Post a Comment

0 Comments