References to const in C++

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 18

  • @haykzhamharyan5286
    @haykzhamharyan5286 10 месяцев назад +4

    It's taken from the C++ primer book however the explanation is so exact that even after reading, it is a pleasure to revise the knowledge from your content. Thanks keep going!!!

  • @babishababisha5558
    @babishababisha5558 4 месяца назад

    So glad that I found this channel.. You explain really well..

  • @tadelemesfin2558
    @tadelemesfin2558 2 года назад +3

    Please do all c++ from basic to advanced.

  • @hamzaabokoura2758
    @hamzaabokoura2758 3 года назад +2

    thank you doctore
    you dont know how much you are great
    yiur amazing in explaining
    keep goint

  • @10tronic
    @10tronic 6 месяцев назад

    Excelente explicación. Gracias!!!

  • @dipeshsamrawat7957
    @dipeshsamrawat7957 3 года назад +1

    I love Neso Academy. ❤️

  • @bilalahmedkhan5876
    @bilalahmedkhan5876 2 года назад +3

    This is probably the most confusing topic in whole C++

  • @omarahmed8716
    @omarahmed8716 3 года назад

    Please upload video that will talk about how to code faster in vscode

  • @pavani8943
    @pavani8943 3 года назад +3

    yesterday didn't upload any video 😕 😢 😪 😔. why?sir!!!!!!!

  • @sasmitagemel123
    @sasmitagemel123 3 года назад +2

    Sir help me for clarifying this c++

  • @mdimadullah6365
    @mdimadullah6365 3 года назад

    Thanks sir plz upload daily

  • @ave2774
    @ave2774 3 года назад +2

    looking forward for the oop topic

  • @rajeshprajapati1851
    @rajeshprajapati1851 3 года назад

    ❤️❤️❤️

  • @AbcnaihauHnahUznnz
    @AbcnaihauHnahUznnz 2 года назад

    Hello Sir, i have a doubt
    if we write
    const int i = 100;
    const int &ptr = i; // ptr is refrence to const so we can not change the value of i using ptr that's fine i,e ptr = 11; is illegal
    but when we write
    int j = 19;
    const int & ptr1 = j; // here ptr1 is not "reference to const" rather it's reference to a non const so, writing ptr1 = 1222; should be legal
    but it's not y?

    • @mayobyohassan500
      @mayobyohassan500 2 года назад +1

      // take an example below
      int i = 50;
      // when a pointer is declared like this (1 consts)
      const int* p = &i;
      // The "const" does not mean a pointer is a constant, it's for the bounded object "i". it simply adds a restriction to the pointer as below.
      // WHICH MEANS
      // YOU CAN'T CHANGE VALUE OF POINTED TO OBJECT USING THIS POINTER.
      -----------------------------------PHASE 2-------------------------------------------
      // if you want a constant pointer, then do this (2 consts)
      const int *const p1 = &i;
      // the 1st "const" means, you can not change the value of the bounded object "i" using the pointer
      // the 2nd "const" means the pointer is a constant, meaning you can't reassign it or change the address it points to

    • @wealthmaster69
      @wealthmaster69 2 года назад +1

      @@mayobyohassan500 jhakkas explanation boss 🤙

    • @rajeshprajapati6662
      @rajeshprajapati6662 2 года назад +1

      So const int &r1 can be read as "r1 is a reference to an int const". Basically, r1 refers to an int which cannot be modified. This means that the referred-to int is either a const int, or it's a simple int.

  • @muskanshekhar
    @muskanshekhar Год назад

    😮