10. Character Arrays | C++ Placement Course

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.ย. 2024
  • Notes of this lecture: drive.google.c...

ความคิดเห็น • 585

  • @ankitraj9017
    @ankitraj9017 2 ปีที่แล้ว +73

    frankly speaking, rohit gupta sir's way of teaching haerdly making any one understand any topic completely

  • @rohanpatidar986
    @rohanpatidar986 3 ปีที่แล้ว +72

    in palindrome question, loop condition can be optimised by for(int i=0; i

    • @rajatmittal48
      @rajatmittal48 3 ปีที่แล้ว +13

      Good thought but i think still time complexity is o(n)

    • @gussaillaunda1384
      @gussaillaunda1384 3 ปีที่แล้ว +6

      but i think it wont work as lets take the example of odd numberd words and for the even one the condition for the if nad else condition will be tricky and i think that for even too it wont work you know but good to think that its just my thinking please let me know if i am wrong anywhere

    • @satyamtripathi888
      @satyamtripathi888 3 ปีที่แล้ว +2

      @@gussaillaunda1384 you are right

    • @manavpatni6643
      @manavpatni6643 3 ปีที่แล้ว +1

      @@gussaillaunda1384 yeah you're right

    • @tanned_cosines_
      @tanned_cosines_ 3 ปีที่แล้ว +20

      @@gussaillaunda1384 the thing is,
      CASE 1: RACECAR (length = 7)
      n/2 comes as 3.5 and c++ will round it to 3
      CASE 2: AAAAAA (length = 6, as not many even length palindrome exist, lol)
      n/2 comes as 3
      hence finally, be it even or odd n/2 is same, the condition will be for both and its optimized :D

  • @vivekpatankar895
    @vivekpatankar895 3 ปีที่แล้ว +138

    The way you explain theory is really very good but the time when you explain the codes of the problems it seems lack of efforts...I mean you just write the code and dictate it, you aren't explaining that how it works

  • @md.ualiurrahmanrahat2400
    @md.ualiurrahmanrahat2400 3 ปีที่แล้ว +62

    Every day learning some mindblowing things from this channel!!! Can't believe they have provided this amount of knowledge entirely free. Lots of love and huge respect for Apna College Team

  • @sohebshaikh3344
    @sohebshaikh3344 3 ปีที่แล้ว +66

    Code thoda aur acche se samjo bhaiya

    • @ayeshanaeem7718
      @ayeshanaeem7718 6 หลายเดือนก่อน

      Exactly

    • @Talhakhan-jq5ee
      @Talhakhan-jq5ee 2 หลายเดือนก่อน

      😊😊😊😊😊😊😊​@@ayeshanaeem7718

    • @manassharma2795
      @manassharma2795 2 หลายเดือนก่อน

      @@Talhakhan-jq5ee padhai pe dhyaan dele

    • @syedmuzair9150
      @syedmuzair9150 10 วันที่ผ่านมา

      Very fast

  • @saadrao804
    @saadrao804 ปีที่แล้ว +13

    this wasn't easily understandable but after some hard work by my own, i am able to understand it, i will request to apna college team that plz elaborate the program. thanks.

    • @farhad7912
      @farhad7912 ปีที่แล้ว

      In 6:33 please tell me how this if(arr[i] != arr[n-1-i])

  • @starkstreak5583
    @starkstreak5583 3 ปีที่แล้ว +3

    kasam se bhai aisa padhaya h...jo bache pehli bar seekh rahe honge unka pata nhi kya hua hoga...beginners ke liye hai par padha pata nahi kaise rahe ho.

  • @rey3635
    @rey3635 3 ปีที่แล้ว +17

    getline function here is used for printing space in between two words of one sentence cuz if we dont do that space key will skip to the next iteration but there is catch cuz we also enable "enter key"to take us to new line and In array new line means new array or array finished so what happens is that after we give cin>>n integer input we hit enter key mostly right so that takes us to new line in character string and we end up making empty array,lol.so we use ignore function to flush out previous inputs buffer so that we can prevent this and hitting "enter key" wont be counted as input at first

  • @ritu5368
    @ritu5368 3 ปีที่แล้ว +30

    I have no words to explain my feelings 🔥🔥🔥🔥💥💥👏👏

    • @raghavchaddha4561
      @raghavchaddha4561 3 ปีที่แล้ว +5

      I don't know that whether you guys are doing the practical or just watching these lectures like another series BUT I am not getting desired output in this case last question and many more previous questions.

  • @swastikjain7373
    @swastikjain7373 3 ปีที่แล้ว +40

    I have a single problem with this amazing playlist ..
    That the timing of uploading, It is not fixed that is why i always waits for the video sometimes it uploaded at 9 or 8 or 7 or 12 and the last one was nearly 1AM ☹️ .
    SO PLEASE BHAIYA JI DO SOMETHING . LOVE YOU BHAIYA KEEP TEACHING, I WILL KEEP LEARNING 😊😊

    • @ujjawalmishra858
      @ujjawalmishra858 3 ปีที่แล้ว +5

      You are only watching 1 playlist of bhaiya...But he is working on multiple playlists...You can support by like, comment and cooperation..

    • @raghavchaddha4561
      @raghavchaddha4561 3 ปีที่แล้ว

      I don't know that whether you guys are doing the practical or just watching these lectures like another series BUT I am not getting desired output in this case last question and many more previous questions.

    • @Harsha08155
      @Harsha08155 3 ปีที่แล้ว

      @@raghavchaddha4561 yeah you are right

    • @rameshmalhotra9525
      @rameshmalhotra9525 2 ปีที่แล้ว

      th-cam.com/video/5FsIa4Mp3ho/w-d-xo.html

    • @PayaswiniSahu
      @PayaswiniSahu 2 หลายเดือนก่อน

      Yess absolutely correct 😢.... I thought I was making any mistakes

  • @abhiroopsingh9320
    @abhiroopsingh9320 3 ปีที่แล้ว +6

    Not at all understood the explanation of the question:largest word in a sentence.

  • @jaweriaamir7993
    @jaweriaamir7993 2 ปีที่แล้ว +1

    "I hope ziada tar logo ny soch lia ho ga, or jinho ny nai socha un k lye ham hain na" Aryy BHAIIII😭😭💖💖

  • @SciTechi
    @SciTechi 3 ปีที่แล้ว +1

    Perfect time ..... Ads ka..... 2 min start hote hi Amazon prime ka ads aa gya .....

  • @bhushanpande2174
    @bhushanpande2174 3 ปีที่แล้ว +5

    An easier solution to find the length of the biggest word in a sentence would be
    #include
    using namespace std;
    int main()
    {
    int n;
    cin>>n;
    char arr[n+1];
    cin.getline(arr,n);
    cin.ignore();
    int count=0;
    int currlen=-1000;
    for(int i=0;icurrlen)
    currlen=count;
    count=0;
    }
    count=count+1;
    }
    cout

    • @meetjain2640
      @meetjain2640 2 ปีที่แล้ว

      galat hain bhai do check or update me

    • @sofiabrown8615
      @sofiabrown8615 2 ปีที่แล้ว +4

      An even more easy appoach will be using conditional operator:
      int count=0, maxLength=0;

      for (int i=0 ; a[i]!='\0' ; ++i) {

      (a[i]==' ' || a[i]=='\0') ? count=0 : count++;

      if (count>ml) {
      maxLength=count;
      }

      }

      cout

    • @priyankshusinha5616
      @priyankshusinha5616 2 ปีที่แล้ว

      Nice

  • @madhavanand756
    @madhavanand756 3 ปีที่แล้ว +16

    Who else noticed Apni Kaksha ?? 😎
    Bhaiya Mistakenly spoke "Apni Kaksha" rather than "Apna College" in very beginning
    Like Phodd Do Abb 😂

  • @swarupyeole5171
    @swarupyeole5171 3 ปีที่แล้ว +10

    1) CLEARING A MISCONCEPTION-
    In palindrome ques sir makes an character array in following way char Arr[n+1] and when we do
    Cin>>arr;
    It actually can store n+2 elements because indexing in array starts from 0 Thus even if you declare array of like this char Arr[n] it is still going to work as it's size is n+1 with Arr[n+1] th element being '\0'
    Now you might be wondering when we declare integer type array like int Arr[n] we consider it's size to be n because when we take input for integer array we take it like this
    For(int i=0 ; i>Arr[i]
    This makes the array of size n as we traverse from 0 to n-1 in loop.

    • @sourabhsingh5941
      @sourabhsingh5941 3 ปีที่แล้ว

      so thoughtful👍

    • @yashkamath9969
      @yashkamath9969 2 ปีที่แล้ว +1

      I think there is misconception, When we declare an char array of size n+1 that means by default the last element of the array is \0.Hence if we want a char array to have n size we should declare the size as n+1 since the last element will be \0. I am very new to learning c++ I may be wrong .Correct me if I am wrong. @Apna COllege

    • @rameshmalhotra9525
      @rameshmalhotra9525 2 ปีที่แล้ว

      th-cam.com/video/5FsIa4Mp3ho/w-d-xo.html

  • @anon35468
    @anon35468 ปีที่แล้ว +16

    //Here my version I used for loop instead of while loop//
    #include
    #include
    using namespace std;
    int main()
    {
    char arr1[] = "Snowfall on this scale is no impediment we can keep moving";
    int n = strlen(arr1);

    int maxlen = 0, currentlen = 0;
    int longestWord = 0, word = 0;
    for(int i=0; i maxlen){
    maxlen = currentlen;
    longestWord = word;
    }
    currentlen = 0;
    word = i+1;
    }
    else{
    currentlen++;
    }
    }
    cout

  • @madhavanand756
    @madhavanand756 3 ปีที่แล้ว +27

    ❗ Palindrome Check in n/2 times only ❗
    Instead of running loop for n times, we can check if palindrome just by running loop n/2 times.
    Here's the code
    flag = true;
    for (int i = 0; i < n/2; i++)
    if(word[i]!=word[n-1-i]){
    flag=false;
    break;
    }
    if(flag==true)
    cout

    • @aryandas7867
      @aryandas7867 2 ปีที่แล้ว +1

      actually it will be (n+1)/2 as you need to keep in mind about odd and even numbers

    • @mihirmall1696
      @mihirmall1696 2 ปีที่แล้ว +2

      @@aryandas7867 but time complexity will be remain of O(n)

    • @nirbhaisai3421
      @nirbhaisai3421 2 ปีที่แล้ว

      @@mihirmall1696 How? ..it will be O(n/2), right?

  • @atanudebnath05
    @atanudebnath05 5 วันที่ผ่านมา

    You're teaching new things like we know it already

  • @rajfekar4839
    @rajfekar4839 3 ปีที่แล้ว +13

    sir not apni kaksha it is apna college😎

    • @raghavchaddha4561
      @raghavchaddha4561 3 ปีที่แล้ว +2

      I don't know that whether you guys are doing the practical or just watching these lectures like another series BUT I am not getting desired output in this case last question and many more previous questions.

  • @ilovepeace
    @ilovepeace 2 ปีที่แล้ว +4

    Rishabh bhaiya teaches best 🔥🔥

  • @pradyumn8507
    @pradyumn8507 3 ปีที่แล้ว +8

    Speechless!! Waiting for preparing nimcet playlist 🤔

    • @pujapurwar4505
      @pujapurwar4505 3 ปีที่แล้ว

      Did he said he will upload it?

    • @pradyumn8507
      @pradyumn8507 3 ปีที่แล้ว

      @@pujapurwar4505 yup i said previously many comments but not replied yet 👎

    • @dipakkumarmandal7248
      @dipakkumarmandal7248 3 ปีที่แล้ว

      @@pujapurwar4505 what is nimcet

    • @aman_sahu
      @aman_sahu 3 ปีที่แล้ว

      @@dipakkumarmandal7248 It is a national level entrance exam for doing MCA from NIT's

    • @rameshmalhotra9525
      @rameshmalhotra9525 2 ปีที่แล้ว

      th-cam.com/video/5FsIa4Mp3ho/w-d-xo.html

  • @shreyaamritkar1331
    @shreyaamritkar1331 3 ปีที่แล้ว +16

    pls add questions for practise in notes

  • @singh_04
    @singh_04 3 ปีที่แล้ว +10

    idk but felt like genius after writing that "max word" code 😃

  • @yogeshdharya3857
    @yogeshdharya3857 2 ปีที่แล้ว +1

    0 : 37 your Fking genius. The concept behind all this is quite crystal clear.Thank u so much Stay healthy.

  • @AmanSingh-wk3iv
    @AmanSingh-wk3iv 2 ปีที่แล้ว +7

    On opening notes it is showing file is in the owner's trash .
    but earlier we are able to open and download notes .
    Mam/Sir please provide the notes again

  • @developerNik
    @developerNik ปีที่แล้ว +1

    Character arrays are initialized by char arr[n+1]
    Aur yaha n+1 hai cuaz last wale me '/0' ayega for that char array to terminate
    Then uska input lene ke liye direct cin

    • @farhad7912
      @farhad7912 ปีที่แล้ว

      In 6:33 please tell me how this if(arr[i] != arr[n-1-i])

  • @akesh39
    @akesh39 3 ปีที่แล้ว +4

    Aman sir you and your Team is best 🤘

  • @amanlohiya2975_
    @amanlohiya2975_ 3 ปีที่แล้ว +3

    Ek Number Bhaiya!
    Bhaiya In Starting " Apni kaksha " likha hua hai ANimation mai

  • @DTALKS01
    @DTALKS01 ปีที่แล้ว +3

    frankly speaking , your teaching speed is too fast i means if i am learning this first time than your should explain more detail....

  • @mohammadrafikbhai9516
    @mohammadrafikbhai9516 3 ปีที่แล้ว

    GOOGLE VALA BHAI AWSOME. ....HAR VIDEO KUCH NA KUCH UNIQUE SIKATA HAI

  • @lappu_sa_sachin_seema
    @lappu_sa_sachin_seema 3 ปีที่แล้ว +10

    sir, Please thoda aur detail me explain kiya kariye.. nayi nayi terminology ko aise hawa mat udaiye sir

  • @AbhishekSingh-eo6bi
    @AbhishekSingh-eo6bi 3 ปีที่แล้ว +5

    To be honest
    this video is not so understanding like previously..cause of speed and explaintion..for me as beginners 😭
    Aman bhai kis baat ki saza de rahe ho..❤️🔥👍🏻

  • @prashantsahu5274
    @prashantsahu5274 3 ปีที่แล้ว +1

    to print the longest word in a sentence
    #include
    using namespace std;
    int main()
    {

    int n;
    cin>>n;
    cin.ignore();
    char a[n+1];
    cin.getline(a,n);
    cin.ignore();
    int currentlength = 0;
    int maxlength=INT_MIN;
    int s=0;
    int maxs=INT_MIN;
    for (int i = 0; i < n; i++)
    {
    if (a[i]==' ' || a[i]=='\0')
    {

    if (currentlength>maxlength)
    {
    maxs=s;
    }
    maxlength=max(maxlength,currentlength);
    currentlength=0;
    s=i+1;
    }
    else
    {
    currentlength++;
    }

    }
    for (int i = 0; i < maxlength; i++)
    {
    cout

  • @yashshukla9051
    @yashshukla9051 3 ปีที่แล้ว +18

    Video ki pehli line thi "Welcome to Apni Kaksha". It should be rather "Welcome to Apna College" ☺☺

    • @khushimaan.6598
      @khushimaan.6598 3 ปีที่แล้ว +1

      🤭🤭🤭..ye to mene dekha hi nhi

    • @rajeshjha6801
      @rajeshjha6801 3 ปีที่แล้ว +1

      Bhai ye log jyada videos apni kaksha pe upload Karte hai na isiliye

    • @prayagjasani
      @prayagjasani 2 ปีที่แล้ว

      Company ka name apani kaksha hai isiliye koi mistake nahi hai

    • @peekybot2818
      @peekybot2818 2 ปีที่แล้ว

      Wow genius 😂

  • @rutvikrana512
    @rutvikrana512 3 ปีที่แล้ว +22

    I think next topic should be "string" because we don’t use char array usually.

    • @Biliphang088
      @Biliphang088 3 ปีที่แล้ว

      pointers as well

    • @rutvikrana512
      @rutvikrana512 3 ปีที่แล้ว

      Biliphang Basumatary ... yep 👌

    • @rameshmalhotra9525
      @rameshmalhotra9525 2 ปีที่แล้ว

      th-cam.com/video/5FsIa4Mp3ho/w-d-xo.html

  • @prakharsharma8718
    @prakharsharma8718 3 ปีที่แล้ว +5

    Thanks bhaiya.,....for increasing speed as per the timeline ☺️☺️

  • @mojojojo-k6v
    @mojojojo-k6v ปีที่แล้ว +1

    Alternate Solution:-
    Used std::isalpha() from header
    Approach:-
    Since words are made up of alphabets , we can simply count anytime the char array has an alphabet in it.
    during spaces or null character we will check if the current word length is greater than the already existing maximum .
    Code:-
    char arr[20];
    cin.getline(arr,20);
    int current_word_length=0;
    int maximum=-1;
    for(int i=0;i

  • @aditivibhute9457
    @aditivibhute9457 3 ปีที่แล้ว +13

    Why do we even need to study character array when we have strings in c++, It's creating confusion. Also, character array is an array so why don't we input elements in it like we did for integer arrays i.e. using for loop ?

    • @only_for_fun1234r
      @only_for_fun1234r 2 ปีที่แล้ว

      I had a same doubt , is this possible in string??

  • @rushikeshkawade1333
    @rushikeshkawade1333 3 ปีที่แล้ว +1

    Sir kya chuumeshwari sikhate ho ❤️

  • @arka6302
    @arka6302 3 ปีที่แล้ว +1

    we can reduce a if condition inside while loop by:
    while(a[i]!='\0')
    {
    if(a[i]!=a[n-i-1])
    {
    p=false;
    break;
    }
    i++;
    }

  • @mayurkapadnis4265
    @mayurkapadnis4265 3 ปีที่แล้ว +2

    'Largest word in a sentence' starts from 6:23

  • @TonyStark-nl9uj
    @TonyStark-nl9uj 3 ปีที่แล้ว +13

    Pls start web development series. ...

    • @raghavchaddha4561
      @raghavchaddha4561 3 ปีที่แล้ว +1

      I don't know that whether you guys are doing the practical or just watching these lectures like another series BUT I am not getting desired output in this case last question and many more previous questions.

    • @TonyStark-nl9uj
      @TonyStark-nl9uj 3 ปีที่แล้ว

      @@raghavchaddha4561 I'm not watchin these now

    • @rameshmalhotra9525
      @rameshmalhotra9525 2 ปีที่แล้ว +1

      th-cam.com/video/5FsIa4Mp3ho/w-d-xo.html

    • @TonyStark-nl9uj
      @TonyStark-nl9uj 2 ปีที่แล้ว +1

      @@rameshmalhotra9525 thnku

  • @anshumanp74
    @anshumanp74 3 ปีที่แล้ว +3

    Am not against the video content it's superb but the only thing which am concerned is the dates i mean Aman bhaiya has given the index with dates for this course and according to tht we should have been finishing week 5 content by 11th Nov
    But we r at 1 st topic of week 4 as of right now 10th lec
    Instead of lec 20 or 21
    Am saying this because bhaiya told tht the videos r already been made and they have stacked them

  • @suman-majhi
    @suman-majhi 3 ปีที่แล้ว +11

    There's a mistake in 0:42 .... you used forward slash in '/0' it should be '\0' with backward slash 😄😄

    • @snehilsinha4689
      @snehilsinha4689 3 ปีที่แล้ว

      nice observation.

    • @rahulprasad3575
      @rahulprasad3575 3 ปีที่แล้ว

      its animation team mistake i guess
      and mistake is so minor that no body observed

    • @suman-majhi
      @suman-majhi 3 ปีที่แล้ว

      @@rahulprasad3575 yes it doesn't matter.... but beginner should get aware for this

    • @rameshmalhotra9525
      @rameshmalhotra9525 2 ปีที่แล้ว

      th-cam.com/video/5FsIa4Mp3ho/w-d-xo.html

  • @mohitraj2535
    @mohitraj2535 2 ปีที่แล้ว

    hey! thanks for telling the world thst you are my friend and also that i am not a palindrome

  • @khushankmadaan9407
    @khushankmadaan9407 3 ปีที่แล้ว +11

    //No use of Curr_start is required for updating the max_start... you can do it using max_start = current_index(i) - max_length...
    #include
    using namespace std;
    int main()
    {
    int size;
    cin >> size;
    cin.ignore();
    char *array = new char[size + 1];
    cin.getline(array, size);
    cin.ignore();
    int curr_length = 0, max_length = 0;
    int max_start = 0;
    int i = 0;
    while (1)
    {
    if (array[i] == ' ' || array[i] == '\0')
    {
    if (curr_length > max_length)
    {
    max_length = curr_length;
    max_start = i - max_length;
    }
    curr_length = 0;
    }
    else
    {
    curr_length++;
    }
    if (array[i] == '\0')
    {
    break;
    }
    i++;
    }
    cout

  • @himanshudawande360
    @himanshudawande360 3 ปีที่แล้ว +11

    if possible could you explain it in more detail if you are introducing any new special function

  • @divyanshujod
    @divyanshujod 3 ปีที่แล้ว +4

    Aman dhattarwal best in the world

  • @prashantsahu5274
    @prashantsahu5274 3 ปีที่แล้ว +2

    short method to solve longest word in sentence problem using for loop
    #include
    using namespace std;
    int main()
    {

    int n;
    cin>>n;
    cin.ignore();
    char a[n+1];
    cin.getline(a,n);
    cin.ignore();
    int currentlength = 0;
    int maxlength=INT_MIN;
    for (int i = 0; i < n; i++)
    {
    if (a[i]==' ' || a[i]=='\0')
    {
    maxlength=max(maxlength,currentlength);
    currentlength=0;
    }
    else
    {
    currentlength++;
    }

    }
    cout

  • @SudeepJoshi22
    @SudeepJoshi22 3 ปีที่แล้ว +7

    10:51 how the code got corrected just by putting 'else'???? 🤔🤔🤔🤔

    • @bdbrightdiamond
      @bdbrightdiamond 3 ปีที่แล้ว

      It was counting space and null character too , I was shocked that he was not using continue keyword inside if or else keyword outside if..

    • @utkarshagrawal6051
      @utkarshagrawal6051 3 ปีที่แล้ว +2

      bhai jab else ke andar ek line likhnee ho toh tab bracket lagao ya mat lagao koi farak nhi padta....ye baat pehle vaali videos ke andar bata rakhi hai...

  • @ujjwalmahajan7581
    @ujjwalmahajan7581 3 ปีที่แล้ว +5

    Bhaiya please upload 12th organic as fast as possible
    Who want the same, like below so that it reaches to Bhaiya as soon as possible

  • @BeingBros
    @BeingBros 6 หลายเดือนก่อน

    better approach for last question
    int main()
    {int n;
    cin>>n;
    cin.ignore();
    char arr[n+1];
    cin.getline(arr, n);
    cin.ignore();
    int maxlen = 0;
    int currlen = 0;
    int i = 0;
    for(int i;imaxlen)
    {maxlen = currlen;
    }
    currlen =0;
    }
    else
    currlen ++;
    break;
    }
    }
    cout

  • @tellingeverything199
    @tellingeverything199 2 ปีที่แล้ว +2

    this is not a beginner course, it is too difficult to understand code.

  • @vedang6776
    @vedang6776 2 ปีที่แล้ว +2

    You can also solve largest word in a sentence by using ascii table
    here's how :
    // character array will treat space as a terminating character hence we'll use string
    string arr;
    getline(cin,arr);
    int i = 0;
    int wordmax = 0;
    int counter = 0;
    while(arr[i] != '\0')
    {
    if(arr[i] == 32)
    {
    counter = 0;
    }
    if((arr[i] >= 65 && arr[i] = 97 && arr[i]

    • @gurtegsinghsohi411
      @gurtegsinghsohi411 ปีที่แล้ว

      When I input 5 and apple .. output comes a p p l .... e is missing ... Can you explain why 🙏🙏🙏
      Here is the code
      #include
      using namespace std;
      int main(){
      int n;
      coutn;
      cin.ignore();
      char arr[n+1];
      cin.getline(arr,n);
      cin.ignore();
      for(int i=0;i

  • @ahmeddon7179
    @ahmeddon7179 3 ปีที่แล้ว

    Salam bhai plzz reply krna me wait kruga..ap bht axha smjha rhy BTW ap konsa compiler use kr rhy now I have a hope k mery axhy marks a jaen gay

  • @shivprakashchaubey2721
    @shivprakashchaubey2721 3 ปีที่แล้ว +2

    This code is gazab liked it most🤘🤘

  • @devbatra3365
    @devbatra3365 3 ปีที่แล้ว +7

    Could someone explain the use of cin.ignore()! I couldn't clearly understand.

    • @nagendra4679
      @nagendra4679 3 ปีที่แล้ว +1

      here is the your answer...
      www.tutorialspoint.com/what-is-the-use-of-cin-ignore-in-cplusplus#:~:text=The%20cin.,using%20the%20ignore()%20function.

  • @Harshit_yt1204
    @Harshit_yt1204 3 ปีที่แล้ว +3

    not a playlist for begginers.It is quite difficult.

  • @thejasd8997
    @thejasd8997 3 ปีที่แล้ว +10

    cin.getline(arr,n)
    For this , shouldn't the size be n+1

    • @amaankhan8436
      @amaankhan8436 3 ปีที่แล้ว

      no bro we are only picking n characters from the input so i think n is correct not n+1

    • @thejasd8997
      @thejasd8997 3 ปีที่แล้ว +1

      @@amaankhan8436 what about null character, shouldn't it be included?

    • @amaankhan8436
      @amaankhan8436 3 ปีที่แล้ว

      @@thejasd8997 it is included in the array that we declared but "n" in cin.getline(arr,n) represents the number of characters that we wish to input. So it is n and not n+1

    • @satyamtripathi888
      @satyamtripathi888 3 ปีที่แล้ว +1

      @@thejasd8997 When you enter a word..say "Rohit" do you also enter '\0'...NO... it is automatically inserted... so you online write the no. of characters that you are going to enter (here 5) ....but we need to give space of 6 for the character array so that there is space for '\0' to be inserted

    • @raghavchaddha4561
      @raghavchaddha4561 3 ปีที่แล้ว +1

      I don't know that whether you guys are doing the practical or just watching these lectures like another series BUT I am not getting desired output in this case last question and many more previous questions.

  • @cse3_01_abhijeet5
    @cse3_01_abhijeet5 3 ปีที่แล้ว +1

    why is the audio increasing and decreasing?

  • @shivammaurya3451
    @shivammaurya3451 3 ปีที่แล้ว +1

    Thank u bhaia best video with best explanation😃😃

  • @aryachakraborty8673
    @aryachakraborty8673 3 ปีที่แล้ว +10

    Who wants Java Course ??
    Aman Bhaiya please Turn On Monetization

  • @manthantiwari782
    @manthantiwari782 3 ปีที่แล้ว +2

    Thank you always

  • @pokegogamer
    @pokegogamer 2 หลายเดือนก่อน

    got shoutout at 3:45 😎😎😎

  • @souravmaji4712
    @souravmaji4712 3 ปีที่แล้ว +1

    Plz plz plz bhaiya , aap daily videos c++ placement series ka dalea ga tab jake time pe khatam hoga ye series nhe tho ma aage kuch ban nhe payunga

  • @supersu6138
    @supersu6138 3 ปีที่แล้ว

    if u dunno size of char arr then this is how u do it
    char sentence[100] = "this is the not the largest word.";
    int maxCount = 0;
    int start= 0;
    int currStart,currEnd = 0;
    int i=0;
    while(sentence[i]!='\0'){
    if(sentence[i]==' '){
    if(currStart>0){
    currEnd = i;
    if(maxCount

  • @yashsingalkar9575
    @yashsingalkar9575 3 ปีที่แล้ว +7

    I didn't get last program's last part, how to print maxlength word

    • @thedarkvision6219
      @thedarkvision6219 3 ปีที่แล้ว

      Same here bro

    • @thedarkvision6219
      @thedarkvision6219 3 ปีที่แล้ว

      I also not understand

    • @satviksrivastav2045
      @satviksrivastav2045 3 ปีที่แล้ว +1

      #include
      #include
      #include
      using namespace std;
      int main()
      {
      int n;
      cin >> n;
      cin.ignore();
      char a[n + 1];
      int i = 0;
      cin.getline(a, n);
      cin.ignore();
      int star = 0, ends = 0;
      int cl=0,ml=0;
      while (i ends)
      {
      ends = star;
      ml=i;
      cl=i-ends;
      }
      star = 0;
      }

      else
      star++;
      if (a[i] == '\0')
      {
      break;
      }
      i++;
      }
      cout

    • @satviksrivastav2045
      @satviksrivastav2045 3 ปีที่แล้ว

      @@thedarkvision6219 #include
      #include
      #include
      using namespace std;
      int main()
      {
      int n;
      cin >> n;
      cin.ignore();
      char a[n + 1];
      int i = 0;
      cin.getline(a, n);
      cin.ignore();
      int star = 0, ends = 0;
      int cl=0,ml=0;
      while (i ends)
      {
      ends = star;
      ml=i;
      cl=i-ends;
      }
      star = 0;
      }

      else
      star++;
      if (a[i] == '\0')
      {
      break;
      }
      i++;
      }
      cout

    • @ShubhamSaraf30
      @ShubhamSaraf30 3 ปีที่แล้ว

      @@satviksrivastav2045 bro plz explain. Code toh sir bhi likhe hai but samajh nahi paye

  • @keshavgarg1158
    @keshavgarg1158 2 ปีที่แล้ว +1

    The value taken from n in the array for its size by user input but this array would become infinite size of array.

  • @grimreaper8856
    @grimreaper8856 ปีที่แล้ว +1

    writing the {cin.ignore();} didn't worked for me as it wasn't printing the last character of the sentence, instead it was printing a small box. I found the error. If anyone is facing a similar issue here's the code for you that might work.
    #include
    using namespace std;
    int main()
    {
    int n;
    cin >> n;
    cin.ignore();
    char a[n + 1];
    cin.getline(a, n + 1);
    int currlen = 0, maxlen = 0, mxst = 0, st = 0;
    for (int j = 0; j < n + 1; j++)
    {
    if (a[j] == ' ' || a[j] == '\0')
    {
    if (currlen > maxlen)
    {
    maxlen = currlen;
    mxst = st;
    }
    currlen = 0;
    st = j + 1;
    }
    else
    currlen++;
    }
    cout

  • @dopetechman7921
    @dopetechman7921 3 ปีที่แล้ว +2

    in the problem where we find the longest number (7:10). Can we do like this
    #include
    using namespace std;
    int main(){
    int n;
    cin>>n;
    cin.ignore();
    char arr[n+1];
    cin.getline(arr, n);
    cin.ignore();
    int len=0,maxlen=0;
    for(int i=0;i

    • @musicverse9
      @musicverse9 3 ปีที่แล้ว

      no the code don't have any limitations. I also coded it in a similar manner.

    • @deepikasingh6051
      @deepikasingh6051 3 ปีที่แล้ว

      Maine bhi same tarike se kiya hai par mujhe bhai ne kya kiya hai clear nhi hua aur bohot saare error aa rhe hai iss 2nd code mein

  • @PujaSingh-tg3zr
    @PujaSingh-tg3zr 3 ปีที่แล้ว +1

    Thanks to all of you...

  • @55kaAadi
    @55kaAadi 3 ปีที่แล้ว +2

    kl 3:00 pm pr real state pr video Mil jaigi aap sbhi ko.... jisme aman Bhiya ne detailed me sb kch btaya hoga ...by the way thanks to all for this great fan following of aman bhiya

  • @sikandarbhide5354
    @sikandarbhide5354 2 ปีที่แล้ว +1

    The Easier way can be :
    #include
    using namespace std;
    int main()
    {
    string g;
    getline(cin, g);
    int a = g.length();
    int n = 0, t1 = 0;
    for (int i = 0; i < a; i++)
    {
    if ((int)g[i] != 32)
    {
    n++;
    }
    else
    {
    t1 = max(t1, n);
    n = 0;
    }
    }
    cout

    • @manurbhavarya6924
      @manurbhavarya6924 2 ปีที่แล้ว

      hey what's int g[i] != 32 ? i mean whats 32 there, i actually wrote almost the same program but not getting the right ans

  • @gauravjain1444
    @gauravjain1444 3 ปีที่แล้ว +6

    *DOUT*
    plz explain the way u took an input with spaces and u talked about buffer, what is that ?

    • @deveshb793
      @deveshb793 3 ปีที่แล้ว

      Same doubt

    • @sohanjangid1207
      @sohanjangid1207 3 ปีที่แล้ว

      bro konsi year me he

    • @gauravjain1444
      @gauravjain1444 3 ปีที่แล้ว

      @@sohanjangid1207 1st

    • @sumitmukharjee5816
      @sumitmukharjee5816 3 ปีที่แล้ว +2

      see this link it has got all doubts regarding buffer and spaces www.tutorialspoint.com/what-is-the-use-of-cin-ignore-in-cplusplus#:~:text=The%20cin.,using%20the%20ignore()%20function

    • @sohammukherjee_2193
      @sohammukherjee_2193 3 ปีที่แล้ว

      same doubt last question mein

  • @ireshkalki
    @ireshkalki 3 ปีที่แล้ว +3

    Bhaiya, palindrome wale ques. Mai for loop mai aapne 'n/2' na leke aapne 'n' kyu liya. 'n/2' lete to wo aur optimised hota? Pls bataiye

    • @rishabhgupta1876
      @rishabhgupta1876 3 ปีที่แล้ว

      That is also correct. If you see carefully, both are O(n) solutions!

  • @SharvanKumar-ui1kw
    @SharvanKumar-ui1kw 3 ปีที่แล้ว +2

    Thank u so much
    Plz continue

    • @yusufkhan7324
      @yusufkhan7324 3 ปีที่แล้ว

      th-cam.com/play/PLUvbkhYCyw11OWRmdKkUMQ1_j9J2Zkpvf.html
      Full

  • @mayurgupta128
    @mayurgupta128 2 ปีที่แล้ว +1

    Notes for this lecture can't be found on this link.

  • @iamriyazsheikh
    @iamriyazsheikh 3 ปีที่แล้ว +1

    0:02 welcome to apni kaksha....???

  • @AryanMole
    @AryanMole หลายเดือนก่อน

    Bhaiya yeh question same hum string length use karke bhi kar sakte hain

  • @Rishabh-VIT
    @Rishabh-VIT ปีที่แล้ว

    Sorry, the file you have requested does not exist.
    Make sure that you have the correct URL and the file exists.

  • @satyasamhita77
    @satyasamhita77 3 ปีที่แล้ว +1

    on a serious note , explanation needs to be improved for better understanding! channel is too good with all the concepts but code explanation is like dictating the code written over the screen!

  • @manishisaxena2712
    @manishisaxena2712 3 ปีที่แล้ว +1

    Sir agar words ke beech me 1 space se jada space hoga to ye galat print krega

  • @vishalprajapati1208
    @vishalprajapati1208 3 ปีที่แล้ว

    Thanks to all pepole

  • @shrutigupta9319
    @shrutigupta9319 3 ปีที่แล้ว +2

    Another solution of Palindrome:
    # include
    using namespace std;
    int main ( ){
    int n,i,b;
    cin>>n;
    char arr[n+1];
    cin>>arr;
    for(i=0;(n%2==0)?i

  • @Pseudo_Harsh
    @Pseudo_Harsh 2 หลายเดือนก่อน

    bhai dekh ngl 9:30 ke aage jo tumne padhyaa kuch samajh ni aayaa
    aapne notes revise krne aaye the kyaa?

  • @vividhalade0992
    @vividhalade0992 2 ปีที่แล้ว +1

    File is in trash, unable to get it.
    Plz Remove it from trash
    If anyone have this pdf, send me.its a request

  • @adityapradhan5235
    @adityapradhan5235 หลายเดือนก่อน +2

    Kuch nahi samajh raha

  • @mhamza016
    @mhamza016 3 ปีที่แล้ว

    Bahi swagat tu theks kari hamara😁

  • @004_sreelemonchandramohont9
    @004_sreelemonchandramohont9 2 ปีที่แล้ว

    Sir you go so fast ...and I am Bangladeshi please talk little slowly and satay more on main topics

  • @anuragabhishek1679
    @anuragabhishek1679 3 ปีที่แล้ว +2

    Aree bhaiya plz python bhi lao jesi speed se ye dal raha h plz bhaiya

  • @shahzaibkhan5613
    @shahzaibkhan5613 2 ปีที่แล้ว

    how are you creating static array at runtime .? its an error ... you can't create static array at runtime ...

  • @raghavchaddha4561
    @raghavchaddha4561 3 ปีที่แล้ว +4

    I don't know that whether you guys are doing the practical or just watching these lectures like another series BUT I am not getting desired output in this case last question and many more previous questions.

    • @aryansaxena4978
      @aryansaxena4978 3 ปีที่แล้ว

      don't give up man, learning something new always takes time. u can!

    • @mayanksingh6243
      @mayanksingh6243 3 ปีที่แล้ว

      @@aryansaxena4978 he didn't appreciated your commented but i will thanks man for that extra push

    • @aryansaxena4978
      @aryansaxena4978 3 ปีที่แล้ว

      @@mayanksingh6243 yeah man its pretty important to push each other

    • @paramjani1768
      @paramjani1768 3 ปีที่แล้ว

      yes bro I am also facing same problem

    • @paramjani1768
      @paramjani1768 3 ปีที่แล้ว

      have you come up with any solution

  • @CricKabaddi099
    @CricKabaddi099 2 หลายเดือนก่อน

    very tricky explanation

  • @madhurimgupta2887
    @madhurimgupta2887 3 ปีที่แล้ว +7

    In the second question, you are taking n as 10 and giving input string of length 9. I am using codeblocks and a lot of problems are coming with the length of string.

    • @prashantbaghel387
      @prashantbaghel387 3 ปีที่แล้ว

      Kya tumhe iska answer mila

    • @blessyjohn8638
      @blessyjohn8638 3 ปีที่แล้ว

      Me too

    • @Raj_Gada
      @Raj_Gada 3 ปีที่แล้ว

      I am facing same problem

    • @anuragkumarsingh1272
      @anuragkumarsingh1272 3 ปีที่แล้ว +4

      See whatever u'll put inside getline(arr,n) , here n become the total length of the string including null character nd u will only get n-1 space to print ur characters array or string....if u put n+1 inside getline u will get n characters to n characters to print excluding null one

    • @rameshmalhotra9525
      @rameshmalhotra9525 2 ปีที่แล้ว

      th-cam.com/video/5FsIa4Mp3ho/w-d-xo.html

  • @piyushmusaddi1272
    @piyushmusaddi1272 3 ปีที่แล้ว

    what is wrong in the following code for the last qstn:
    #include
    using namespace std;
    int main()
    {
    int n;
    cin>>n;
    cin.ignore();
    char a[n];
    cin.getline(a,n);
    cin.ignore();
    int length=0;
    int maxlength=0;
    for(int i=0;imaxlength)
    maxlength=length;
    }
    else
    length=0;
    }
    cout

    • @apoorvajain9628
      @apoorvajain9628 3 ปีที่แล้ว

      The code should work fine and it should output the number of letters in the largest word.

    • @ayushgoyal3021
      @ayushgoyal3021 3 ปีที่แล้ว

      Bhai baaki Sab Theek hai bas agar tera largest word agar last me hua toh uske aage koi space ni hai, aapne vo condition check ni ki

  • @kartikpaliwal5657
    @kartikpaliwal5657 2 หลายเดือนก่อน

    having problem outputting just one word
    it always shows 1 word less

  • @vaibhavsharma8465
    @vaibhavsharma8465 3 ปีที่แล้ว

    Neha - I am a peaceful soul

  • @ankurghosh543
    @ankurghosh543 2 ปีที่แล้ว

    in largestwordinanarray program the code is only showing the 1st occurence of largest length word not all the word having same length

  • @user-xq6ol2un7z
    @user-xq6ol2un7z 2 ปีที่แล้ว

    But ppt me null character /0 tha lekin code me Aapne \O use Kiya. Kyu?