How to count number of words in a string in C/C++

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

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

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

    does it stil work? when we first gave a space or tab before Writing a letter or word

  • @florent9555
    @florent9555 4 года назад

    so what do you get doing *pStr? the actual character? And what do you increment if you do pStr++? the address of the pointer? Further on I dont get the line where you check ++len == 1, would be nice if you could explain a little more in detail. Thank you.

  • @andrewburke6158
    @andrewburke6158 5 лет назад +1

    Can you show us how to return a single word that we have counted?

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

    what if the word was one caractere like i am hungry its count 2 words

  • @cadetxero443
    @cadetxero443 5 лет назад

    Can this be applied to pattern matching as well ?

    • @cadetxero443
      @cadetxero443 5 лет назад

      For example I need to write a program that recognizes repeated sentences. For example a trigram. ‘one two three one two three one two three’ my program should output
      ‘one two three’ (3)
      ‘two three one’ (2)
      ‘three one two’ (2)
      Could really use some help with this one

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

    nice! how did you figure this out?

  • @reactvotes6153
    @reactvotes6153 4 года назад

    Wow thanks for this video cos I tried to do it 4 hours but it failed before I watch the video .good keep it up

  • @Iabdullaahh
    @Iabdullaahh 4 года назад +1

    I need help

  • @MuffineousMuffin
    @MuffineousMuffin 5 лет назад +1

    the fuck just happened

  • @ObtecularPk
    @ObtecularPk 8 лет назад

    can you teach us how to make scripts, use mouse function to find specific color or thing on screen and move to that location and have it click and other stuff? thx

    • @Programmertube
      @Programmertube  8 лет назад +1

      Rushabh, it seems you're looking for automation scripts. Can you give a specific example so I can focus on it and also what language do you want me to use?

    • @ObtecularPk
      @ObtecularPk 8 лет назад

      yah sure, i know how to use c, and im looking to make scripts to do things like interact with a game (runescape) and do simple task like check events and click. Im sure if you google runescape scripts/bots , youll get the idea of what i want to learn to make using c if possible

    • @Programmertube
      @Programmertube  8 лет назад +1

      Looks like there is a lot of content already on this on youtube and the net that you can look at. I am only focusing on teaching people to program and become good with solving technical problems and be more productive with their coding skill.

  • @hoorkhan3596
    @hoorkhan3596 7 лет назад

    Plzzz makee this program convert of numbers in to words in c programming
    Like 5347 five thousand three hunndered and forty seven

  • @tomyang7788
    @tomyang7788 7 лет назад

    what does this expression mean else if (++len == 1 )

    • @Programmertube
      @Programmertube  7 лет назад +3

      This means, let's count the number of letters in this word and if we just started with the first letter of a new word, then let's increment the number of words we have so far.

  • @chandramanipandey2012
    @chandramanipandey2012 7 лет назад

    i need your help

  • @AhmadAli-ju2lp
    @AhmadAli-ju2lp 8 лет назад +2

    good job

  • @frenchmike
    @frenchmike 6 лет назад +6

    You are too fast for a tutorial

    • @Programmertube
      @Programmertube  6 лет назад

      Sorry. I think if I slow down it will get boring?

    • @shaowlnkngfu3803
      @shaowlnkngfu3803 6 лет назад +2

      A tutorial is suppose to teach someone who doesn't know how to do something. The pace you go at is far to fast to teach a beginner. @@Programmertube

    • @Programmertube
      @Programmertube  6 лет назад

      @@shaowlnkngfu3803 sorry, it Is mainly due to edits as I am not good at editing and cutting out mistakes from my videos ;)

  • @chandramanipandey2012
    @chandramanipandey2012 7 лет назад

    hello

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

    #include
    #include
    using namespace std;
    int wordCount(const string& str);
    int main()
    {
    string str = "How are you?";
    cout