КОМЕНТАРІ •

  • @kkvaruas5759
    @kkvaruas5759 5 років тому +232

    trust me this is the best explanation on youtube about strtok

    • @piyushsaxena6243
      @piyushsaxena6243 4 роки тому +7

      Totally agree

    • @vedantgolash6084
      @vedantgolash6084 3 роки тому +2

      agree

    • @赤金蓮
      @赤金蓮 3 роки тому +3

      I absolutely agree. I've been bashing my head against this for over an hour and I can finally get back to coding!

    • @CSERISHINANDHA
      @CSERISHINANDHA 3 роки тому

      @@赤金蓮 exactly

    • @turnerbrentley3504
      @turnerbrentley3504 3 роки тому

      Sorry to be off topic but does anybody know of a trick to get back into an instagram account?
      I somehow lost the account password. I would love any assistance you can offer me.

  • @DeveloperDesmond
    @DeveloperDesmond 4 роки тому +53

    This is such a good tutorial. It's all content no filler, but you still spend so much explaining all the details and nuances, which is key.

  • @JurGon12
    @JurGon12 4 роки тому +12

    I'm doing my C programming module at uni atm, and you are like a bible to me. Thanks for helping actually understanding C!

  • @DanielDybing
    @DanielDybing 4 роки тому +5

    Great video! I love how you explain things in a very easy and straight-forward way. It's just pure content!

  • @ignaciofernandez3423
    @ignaciofernandez3423 11 місяців тому

    thanks, I´ve seen a couple of videos trying to understand strtok and you are the only one who explained it simple and to the point enough for me to understand

  • @caitlingibbons2246
    @caitlingibbons2246 3 роки тому +2

    Simply excellent. I was initially confused by the nuances of strtok, but this video was quite elucidating.

  • @kashishsingh1931
    @kashishsingh1931 4 роки тому +9

    Thank you, thank you, thank you. This is so good, the explanation. I don't have anything to say as everything has already been said.

  • @atasharichmolina6214
    @atasharichmolina6214 4 роки тому +2

    pls do more of this (functions, tokens, problems in C/C++ and more) it helped me to become aware bcs seriously,, C/C++ have several functions and I badly needed someone who can explain it to me thoroughly bcs we are in an online setting of classes, so basically, self-study is my thing now. appreciate u dude!!

  • @bushraw66
    @bushraw66 2 роки тому +2

    this video is so smooth and easily understandable.THANKYOU

  • @lost-in-my-maze8024
    @lost-in-my-maze8024 5 років тому +26

    your explanation is awesome keep it up !!

  • @bschena
    @bschena 3 роки тому +1

    Thank you! this is a GREAT explanation of what's going on with strtok! I found some example code but couldn't figure out what the heck it was doing. Powerful function to know! Thanks!

  • @rrMaxwell
    @rrMaxwell Рік тому

    excellent explanation. you taught the thing that i was reading on geeks for geeks for an hour in such a short itme

  • @supersmiley2954
    @supersmiley2954 4 роки тому +7

    Thanks buddy for saving my life at university 😅👍

  • @tcszebra2336
    @tcszebra2336 3 роки тому

    After subscribing this channel, i am in love with c coding.

  • @tacotalks3697
    @tacotalks3697 4 роки тому +1

    I love you so much. You're the greatest C programmer and teacher the world has ever seen. You've saved me so much stress.

  • @MissGamesKuma
    @MissGamesKuma Рік тому +1

    Can I just say that your videos are so incredibly helpful!! I have found many videos on UA-cam helpful but this is the channel that I have come back to the most. Super friendly and easy to follow and understand. Plus so much content! Many thanks from a rookie coder!

  • @juansuarezburgos5727
    @juansuarezburgos5727 Рік тому +1

    Love your videos. Getting me through cs 50 at Dartmouth rn

  • @toaastr8409
    @toaastr8409 3 роки тому

    This man is one of the most important men in the world. I believe that.

  • @dmacdougall6183
    @dmacdougall6183 8 місяців тому

    Very good thanks for explaining all the details. I think this also helped me digest some of the other stuff i didnt quite get yet

  • @zyghom
    @zyghom 2 роки тому +1

    I am not sure if C is as simple as Linux or opposite but considering that in Linux/Unix "one program does one thing" is a mantra, and now seeing that C follows the same... Actually probably it is Linux/Unix that took from C. Irrespective: I like this approach. Yes, there are other functions or languages that do many things at once, but as long as they are built on such simple pieces... I like it ;-)

  • @chelilack
    @chelilack 2 роки тому

    I have chocked when saw russian subtitles.Thanks for this

  • @AlashAls
    @AlashAls 4 роки тому +1

    Followed a lot of beginner C tutorials. No one talked about String token. Some books even skipped it.

  • @tidakdiketahui5147
    @tidakdiketahui5147 2 роки тому +1

    Very detailed video. But, i want to ask, how to store that each string into an array?

    • @CodeVault
      @CodeVault 2 роки тому +1

      You could simply define 2D array of characters:
      char pieces[100][100];
      int count = 0;
      And just copy each piece using strcpy, like so:
      strncpy(pieces[count++], piece, 99);

    • @tidakdiketahui5147
      @tidakdiketahui5147 2 роки тому +1

      @@CodeVault Wow, superb. Finally it works. Thank you so much for your help. You've got a new subscriber 😁

  • @Pwnedby
    @Pwnedby Рік тому

    Thats a nice video. Im still learning c. Quick question at 7:24 could i use memory allocation to store each string so i can select the pieces by its index?

    • @CodeVault
      @CodeVault Рік тому

      Of course. Usually I suggest you simply make a statically allocated array of char pointers so you don't have to deal with allocating and deallocating elements of that array

  • @georger844
    @georger844 3 роки тому +1

    Can you make a video about setting up a debugger like yours and how to use it? Also, your videos although short and very specific are very very useful,thanks.

    • @CodeVault
      @CodeVault 3 роки тому +1

      I have this video for VSCode: code-vault.net/lesson/ublnbln8uf:1603733528013
      I no longer use DevC++, but that should work out of the box without any configurations needed.

  • @chamarasilva7700
    @chamarasilva7700 2 роки тому +1

    So strtok function has unfreed memory when excited (Hence it can continue tokenizing). So how will this not be a memory leak issue?

    • @CodeVault
      @CodeVault 2 роки тому +1

      We're not dynamically allocating anything in the video

  • @sandhyag9568
    @sandhyag9568 3 роки тому

    Awesome Explanation....Best teacher you are

  • @FernandoBasso
    @FernandoBasso 3 роки тому +1

    Amazing and useful series for the amazing C Programming Language. Congrats are in order. 👍️
    I would like to ask if it would be possible to make a video (or more than one, perhaps) about handling Unicode and UTF-8 strings (multi-byte strings) in C so we can handle non-ASCII-only, single byte characters as well.

    • @CodeVault
      @CodeVault 3 роки тому +1

      Thanks! I will look into it.

  • @Mikeriker
    @Mikeriker Рік тому

    You expalained it very clearly. Thanks for this! Nice recap in the end haha

  • @dustonspear4618
    @dustonspear4618 4 роки тому +1

    Excellent tutorial. This video helped me very much. Thank you!

  • @thebeesknees7467
    @thebeesknees7467 5 років тому +8

    This helped me a lot. Thank you! :D

  • @steveworks3409
    @steveworks3409 4 роки тому

    Careful, he 's a hero.. Best video about strtok.

  • @BiMathAx
    @BiMathAx 2 роки тому

    Just let me say to you a french thanks'you :
    Merci beaucoup, cette vidéo est complète et permet de comprendre strtok super simplement : MERCI

  • @panagiotiskakalis7360
    @panagiotiskakalis7360 3 роки тому

    Love it!! This will help me for an important program assignment for my uni!

  • @sreyamathew327
    @sreyamathew327 11 місяців тому

    Can you please tell me how to extract part of input string enclosed in " ".
    Like input sentence is: printf( "Result is") and I want to extract the part enclosed in double quotes. It's for lexical analyser using c

    • @CodeVault
      @CodeVault 11 місяців тому +1

      Just use strtok() as shown in the video with the space character as delimiter

  • @TheLuckyyy13
    @TheLuckyyy13 4 роки тому

    Holy shit. I actually understood this better than i could imagine.

  • @slime_stick
    @slime_stick 2 роки тому +1

    Can you please show us how to scan two strings with strtok at the same time?
    I tried doing so and just got both tokens to scan the first string...weird behaviour
    here is the code I tested:
    int main()
    {
    char str1[11] = "mat val mat";
    char str2[15] = "MAT_A, 8, MAT_B";
    char *wanted;
    char *args;
    wanted = strtok(str1, " ");
    args = strtok(str2, " ");
    while(wanted || args )
    {
    if(!wanted && args)
    {
    printf("Error: too many arguments
    ");
    return 1;
    }
    if(wanted && !args)
    {
    printf("Error: too few arguments
    ");
    return 1;
    }
    printf("args is: %s
    wanted is: %s
    ", args, wanted);
    wanted = strtok(NULL, " ");
    args = strtok(NULL, " ");
    }
    if(!args && !wanted)
    printf("both strings are null
    ");
    return 0;
    }
    the output I got was:
    args is: MAT_A,
    wanted is: mat
    args is: MAT_B
    wanted is: 8,
    both strings are null

    • @CodeVault
      @CodeVault 2 роки тому +1

      You basically can't use strtok for two different strings at the same time. strtok retains the previous string (and works with it) while you pass NULL to it. So, since it has some internal state, you can't just call it again with another string then come back to the previous string by calling strtok with NULL

    • @slime_stick
      @slime_stick 2 роки тому

      @@CodeVault wow I can't believe you still reply to a video this old :)
      Is there a way to work around it and somehow use two tokens? like maybe using strtok_r or strsep or just creating another tokening function?
      I solved my specific problem by just replacing one token for a char array but I still wanna see it be done lol

    • @CodeVault
      @CodeVault 2 роки тому

      Hmm... you could do it by retaining the state yourself and never pass NULL to strtok. Something like so:
      char str[] = "this is a test";
      char* res = strtok(str, " ");
      printf("Result is %s
      ", res);
      res = strtok(res + strlen(res) + 1, " ");
      printf("Second result is %s
      ", res);

  • @ahmedsheweita7988
    @ahmedsheweita7988 3 роки тому

    Great Video

    • @CodeVault
      @CodeVault 3 роки тому +1

      Yes, every time you call strtok, it will change piece.

    • @ahmedsheweita7988
      @ahmedsheweita7988 3 роки тому

      Thank you for these amazing videos and for your fast response

  • @lucamartins7216
    @lucamartins7216 3 роки тому

    the best explanation on yt for sure

  • @nenani1817
    @nenani1817 3 роки тому

    WOW!!! this is the best explnation ever!!

  • @marioauditore571
    @marioauditore571 2 роки тому

    this video / explaination really helped me out. End was the best tho " 'C' you next time". :D

  • @hemersonallan
    @hemersonallan Рік тому

    Awesome, Greetings from Brazil !!!

  • @fabianzapata5977
    @fabianzapata5977 4 роки тому

    Hey men i have i question, where is located the function youre using in this video to evaluate each code line youre selecting

    • @CodeVault
      @CodeVault 4 роки тому

      I'm not sure which function you're talking about... You mean the debugger?

  • @RaselAhmed-ix5ee
    @RaselAhmed-ix5ee 4 роки тому

    one of the best tutorials can you help me with a problem its urgent please..reply ASAP

    • @CodeVault
      @CodeVault 4 роки тому

      What's the problem?

  • @carracingsongs
    @carracingsongs 4 роки тому +2

    Juts what I was looking for. Thank you!

  • @Karthik-kt24
    @Karthik-kt24 2 роки тому

    very cool explanation!! explained everything very welll

  • @aliciasamuel312
    @aliciasamuel312 3 роки тому

    Hello! Just wanted to say that your explanations are very detailed and helpful. Is it possible however to set a barrier token and retrieve the character in between it? Example, I would like to retrieve the number 5000 from the input [5000] where "[ ]" is the barrier token so I can assign that number to a variable later on? Sorry if this sounds confusing and thanks in advance for any help :)

    • @CodeVault
      @CodeVault 3 роки тому +1

      Just use the "[]" string as delimiters for strtok. strtok will split at any of the characters found in that string:
      strtok(exampleString, "[]");

    • @aliciasamuel312
      @aliciasamuel312 3 роки тому

      @@CodeVault Ooh i see. Thank you so much :D

  • @lanaalqabaz8080
    @lanaalqabaz8080 5 років тому +1

    I personally prefer to use sscanf although in your example it would require creating a string variable for each word in the string. Might be a bit more work but it's simpler :D

    • @CodeVault
      @CodeVault 5 років тому +4

      Definitely. If you already know the exact number of words the sentence it's going to have *sscanf* is a much better option. Although *strtok* is mostly for parsing an array of any number of elements, that's where using *sscanf* gets a bit tricky.
      The example was supposed to show when you have to parse a string in which is encoded an *unknown* number of elements (in this case, words). In that case, one call to *sscanf* won't be enough. You could use *sscanf* in a while loop (with the format string *%[A-Za-z] %s*) and just keep getting the first word every iteration, which is fancier but requires more work than just using *strtok*.
      Thanks for the feedback!

  • @ronjeremy1232
    @ronjeremy1232 5 років тому +2

    given the position or index of a word in the string, could you remove it with strtok?

    • @CodeVault
      @CodeVault 5 років тому +1

      No, it won't work.
      I suggest using
      strcpy(str + wordIndex, str + wordIndex + wordSize);
      That will basically copy over the last part of your string (after the word you found) over that word, essentially deleting it.

    • @ronjeremy1232
      @ronjeremy1232 5 років тому

      @@CodeVault i used Strtok() to separate each word, then i iterated through them with a loop and copied the words onto a text file, and when i reached the index that was given, i just skipped copying that word

    • @CodeVault
      @CodeVault 5 років тому

      @@ronjeremy1232 Be careful with that. strtok takes a list of characters to split at, not a full string. So if you give it, let's say, "apple", it will split at the characters 'a', 'p', 'l' and 'e'. Not at the string "apple".
      That's why I think you cannot really use it for removing other words.

    • @ronjeremy1232
      @ronjeremy1232 5 років тому

      @@CodeVault but i was forced to use strtok and strcat specifically

    • @ronjeremy1232
      @ronjeremy1232 5 років тому +1

      And i separated them with strtok(str, " ")

  • @pierrethehandsome2518
    @pierrethehandsome2518 3 роки тому

    How would you group elements together? Like say if I wanted "Let's Break" "This String" "Into Pieces"

    • @CodeVault
      @CodeVault 3 роки тому

      That is tricky to do with strtok. I suggest you iterate over your string and break it up that way if you need this custom grouping.

  • @Raja_IT_Trainer
    @Raja_IT_Trainer 3 роки тому

    Great explanation... 👍👍

  • @LYJManchesterUnited
    @LYJManchesterUnited 4 роки тому

    Thanks i manged to get it to work but i wanna store each extracted word into an array but it doesn't work i put for example piece = exampleArray [i]; But it doesn't seem to work . Any help would be greatly appreciated thanks!

    • @CodeVault
      @CodeVault 4 роки тому

      You will have to use strcpy to copy each piece to the array:
      strcpy(exampleArray[i], piece);
      I made a video regarding the difference between assigning and strcpy for strings. Maybe it helps:
      ua-cam.com/video/VQHK2EZZHb8/v-deo.html

  • @minhhuydo2701
    @minhhuydo2701 4 роки тому

    Hi. Thanks for your video!!. I need you help just a litte bit. So my stuff works but It needs more improvement. As you said in 7:45, how can I seperate those spaces and add 0 instead? Or any function to add 0 in the string when there are 2 spaces ?
    Like: "a b"now become"a 0 0 b"

    • @CodeVault
      @CodeVault 4 роки тому +1

      I think iterating over the string and manually checking each character (without using strtok) is the best option in this case

    • @minhhuydo2701
      @minhhuydo2701 4 роки тому

      @@CodeVault ok let me see I can do something to add 0 in between ,,

  • @nikirangdan__
    @nikirangdan__ 3 роки тому

    Sir what if I want to pass the value of piece, in this case the individual words, as a string argument to another function? How do I do that?

    • @CodeVault
      @CodeVault 3 роки тому

      You simply pass it as a char*
      int fn(char* in) { ... }
      // then, after strtok
      fn(piece);

    • @nikirangdan__
      @nikirangdan__ 3 роки тому

      @@CodeVault Hello Sir, very thanks for the response. When I tried to copy your code, it prints the individual values right. However, printing the value is not what I am required to do. What I am required to do Sir is that I need to be able to build a linked list out of the individual pieces that I was able to extract using the strtok() method. So I made a push function that would append each "piece" from the given input string. When I tried to pass the piece and run the code, the output is not the same as the user's. :( I'm afraid the "piece" that was extracted is not of an integer/char type. Please help me sir. Also, may I email you the code for you to be able to fully grasp what I'm saying?

    • @CodeVault
      @CodeVault 3 роки тому

      Yeah, then you might have to allocate space for it in the linked list's node and then call strcpy

  • @bartlomiejodachowski
    @bartlomiejodachowski 2 роки тому

    how to make such function that remembers how many time it was called with same arguments?
    static variable?

    • @CodeVault
      @CodeVault 2 роки тому

      Yea, that would be a nice solution. You could as well just use a global variable

  • @encore4086
    @encore4086 3 роки тому

    Thank youuu, the best explanation about strtok.

  • @manasvinsharma1740
    @manasvinsharma1740 5 років тому +1

    Which ide/compiler are you using?...

    • @CodeVault
      @CodeVault 5 років тому +1

      I'm using Dev C++ since it's lightweight and works out of the box. Here's the download link to it: sourceforge.net/projects/orwelldevcpp/

  • @VasilijeVrbic
    @VasilijeVrbic 4 місяці тому

    Great explanation. Cheers!

  • @eceblog7454
    @eceblog7454 3 роки тому

    Awesome man keep doing I have the following string could you assist me to split it .
    The input as following:-
    +CMGR: "REC READ","12345",,"26/05/21,21:26:48+18"hello-world OK
    The out out should be as following:-
    12345
    26/05/21
    21:26:48
    hello-world

  • @Mr.AIFella
    @Mr.AIFella 4 роки тому

    Thank you for the video. It helps me with my H.W.

  • @joelmanning249
    @joelmanning249 4 роки тому

    Damn fine explanation. strtok has been bugging me for ages :D

  • @ayeshaaj1787
    @ayeshaaj1787 3 роки тому

    Can you please tell how can i print only unique characters of the paragraph using this strtok like how can i store and compare the words with the rest of the words

    • @CodeVault
      @CodeVault 3 роки тому +1

      There's the strcmp function that I cover in this lesson here: code-vault.net/lesson/n14gi3en7o:1603733520733
      If you store the words in an array and use strcmp over the whole array you should be able to find the unique occurrences

    • @ayeshaaj1787
      @ayeshaaj1787 3 роки тому

      @@CodeVault yeah i have stored the words in an array but how will i use this strcmp function over the whole array i can compare single words using this strcmp function but i dont know how to compare the whole array can u help me by writing a short code or just the part where the words will be compared i have been searching all over the internet for last 3 hours but couldnt find anything helpful

    • @CodeVault
      @CodeVault 3 роки тому

      Something like this then:
      int i;
      for (i = 0; i < numUniqueWords; i++) {
      if (strcmp(uniqueWords[i], piece) == 0) {
      break;
      }
      }
      // If nothing found
      if (i > numUniqueWords) {
      strcpy(uniqueWords[++numUniqueWords], piece);
      }
      Where uniqueWords is your array and numUniqueWords is the number of currently unique words you have. This should be somewhere in the while loop for strtok, that 'piece' there is exactly the result from strtok.

    • @ayeshaaj1787
      @ayeshaaj1787 3 роки тому

      @@CodeVault const int size = 1000;
      char Paragraph_str[size];
      cout

    • @CodeVault
      @CodeVault 3 роки тому

      I think the call to strtok_s is wrong. Look at its signature and read at (2): en.cppreference.com/w/c/string/byte/strtok
      Seems like it needs 4 parameters. I suggest you just use strtok.

  • @legomeisterlp4375
    @legomeisterlp4375 3 роки тому

    Very very very good video 👍👍👍👍. Thanks!! 🤓😄

  • @nirajshewalkar3213
    @nirajshewalkar3213 4 роки тому

    Thanks a lot,if you have uploaded any course on udemy or any other online programming site, please tell me.

    • @CodeVault
      @CodeVault 4 роки тому

      There's a course on base convertions for number on Skillshare which you can check out here: www.skillshare.com/r/profile/Sergiu-Muresan/798146080
      Otherwise, most content on Udemy is free and also on UA-cam

  • @atasharichmolina6214
    @atasharichmolina6214 4 роки тому

    best explanation!!!!!!! keep going Mr. :))) you helped me a lot

  • @abdallahac6282
    @abdallahac6282 3 роки тому

    Is there a way to count how many spaces there are in the line?

    • @CodeVault
      @CodeVault 3 роки тому

      Just iterate over the string's characters and compare each one with a space. There's no function that does this for you afaik.

  • @しいなまひる-z5q
    @しいなまひる-z5q Рік тому

    if i have a sentence " Let's play a game ", can it split and return "Let's play a game" , thanks!

    • @CodeVault
      @CodeVault Рік тому

      I think you will need to use strspn for this. There's a video about this function: code-vault.net/lesson/lhwc3bt5kq:1603733527132

  • @d.f.1409
    @d.f.1409 3 роки тому

    How can you put the pieces in an string array after this?

    • @CodeVault
      @CodeVault 3 роки тому

      You can just assign them the piece variable:
      char* strArray[50];
      int count = 0;
      ... // inside the loop
      strArray[count++] = piece;

  • @ronjeremy1232
    @ronjeremy1232 4 роки тому

    did you ever use this method in making a shell program?

    • @CodeVault
      @CodeVault 4 роки тому +1

      Yes, actually. When you need to get the arguments you need to split at the space character.

  • @yorgunkaptaan
    @yorgunkaptaan 3 роки тому

    Thanks a lot, man. This explanation is really helpful.

  • @sexer5953
    @sexer5953 4 роки тому

    but i have question, out of all the loops, why u chose while loop?

    • @CodeVault
      @CodeVault 4 роки тому

      Good question! I could've used a for loop instead, and it would look something like this:
      for (char* piece = strtok(str, " "); piece != NULL; piece = strtok(NULL, " ")) { ... }
      It basically combined 3 lines of code into a really long single line. I just preferred the while loop since it is much easier to understand and explain. Feel free to use either one of them as long as it's easy to understand for you and for your team!

  • @crafty-jax7440
    @crafty-jax7440 4 роки тому

    Great Video, I should be paying you my tuition.

  • @supertonyxd
    @supertonyxd 4 роки тому +1

    Nice explanation!
    Thank you so much!

  • @ankitjha372
    @ankitjha372 4 роки тому

    Best go through explanation!!!

  • @479210251
    @479210251 4 роки тому +1

    Thank you so much for this explanation

  • @swimmerbc
    @swimmerbc 3 роки тому

    Legendary dude, thanks for the explanation!

  • @wishes_07
    @wishes_07 Рік тому

    love u bro !! Great explanation !!

  • @abdullahhussein6905
    @abdullahhussein6905 5 років тому +6

    Thank you Dude.

  • @nightmareaselock7316
    @nightmareaselock7316 2 роки тому

    in which biblio this function contains?

    • @CodeVault
      @CodeVault 2 роки тому

      In string.h, you can just include it like so at the beginning of your main.c file:
      #include

  • @briannguyen1134
    @briannguyen1134 3 роки тому

    how do you copy it to another char/string

    • @CodeVault
      @CodeVault 3 роки тому +1

      You can use strcpy to copy strings in C

  • @Ol_Toby
    @Ol_Toby 4 роки тому

    Is it possible to have multiple delimiters?

    • @CodeVault
      @CodeVault 4 роки тому +1

      Yes, just pass multiple characters to the second parameter of strtok and it will break at either one of them.

    • @Ol_Toby
      @Ol_Toby 4 роки тому

      @@CodeVault awesome that's great, thank you for responding so quickly

  • @sumitsingh-fm2nz
    @sumitsingh-fm2nz 3 роки тому

    thanks man it was really helpful!

  • @rohanrn5515
    @rohanrn5515 4 роки тому

    The best explaination

  • @jcwarain789
    @jcwarain789 3 роки тому

    how did you debug in devc++?

    • @CodeVault
      @CodeVault 3 роки тому

      It should work out of the box... I just add a breakpoint and run the program

  • @voipims
    @voipims 4 роки тому

    give strtok in header / title of video ..so that it can come in search

  • @jestineabraham5185
    @jestineabraham5185 2 роки тому

    if i am taking input from user its not working

    • @CodeVault
      @CodeVault 2 роки тому

      How are you taking input from the user?

  • @innovativehacker3769
    @innovativehacker3769 3 роки тому

    You are Genius mate!!

  • @bharatnarayana8401
    @bharatnarayana8401 3 роки тому

    thank you so much for video saved my day
    {"sam","0004","SDE1","VLSI"} how to break this

    • @CodeVault
      @CodeVault 3 роки тому

      You could probably just use:
      strtok(str, "\",\"");
      And ignore the first and the last piece you get (since those are just gonna have the { and } characters)

  • @swapnil849
    @swapnil849 4 роки тому

    Thanks a lot....u can explain things so well :D

  • @songchovui1905
    @songchovui1905 3 роки тому

    Great, strtok(Null) is what i'm finding.

  • @lalembahmanahsatyaalmahabb8826
    @lalembahmanahsatyaalmahabb8826 3 роки тому

    How to split string into syllibles?

    • @CodeVault
      @CodeVault 3 роки тому

      That depends on the pronuntiation of each word. So probably with a huge lookup table

  • @Ganjena2k
    @Ganjena2k 3 роки тому

    Great explanation!

  • @enricofr7079
    @enricofr7079 3 роки тому

    thanks, great explaination!

  • @shaharrefaelshoshany9442
    @shaharrefaelshoshany9442 3 роки тому

    This is c or c++ ???

    • @CodeVault
      @CodeVault 3 роки тому

      It's in C but should be backwards compatible with C++

  • @nithyasree2698
    @nithyasree2698 4 роки тому

    It's really helpful...tq

  • @ayoubomari1347
    @ayoubomari1347 3 роки тому

    this function will give you a list that contains the result of the splating, you need to enter in arguments section => the string that you want to split it and the string of split:
    std::list strSplice(std::string str, std::string splicer){
    std::string sentence = "";
    std::list commul;
    for(int i = 0; i + splicer.length() < str.length(); i++){
    if(str.substr(i, splicer.length()).compare(splicer)){
    sentence = sentence + str.substr(i, splicer.length());
    }else{
    commul.push_back(sentence);
    sentence = "";
    i += splicer.length() - 1;
    }
    }
    commul.push_back(sentence);
    return commul;
    }

    • @CodeVault
      @CodeVault 3 роки тому +1

      Yea, this is a nice solution. Only issue is that this in C++ and the video is specifically for C. Make sure you understand the difference between the two

  • @piyushsaxena6243
    @piyushsaxena6243 4 роки тому +2

    Thanks a lot.
    Finally I understood strtok.

  • @tyl6194
    @tyl6194 4 роки тому

    clear explanation. Thanks!

  • @hanahalitim7897
    @hanahalitim7897 3 роки тому

    guys plz help me strtok is deleting the first letter from each word

    • @CodeVault
      @CodeVault 3 роки тому +1

      How are you calling strtok?

    • @hanahalitim7897
      @hanahalitim7897 3 роки тому

      @@CodeVault hey thank u so much ^^ I've used strtok_r instead n it's working perfectly. I didn't know that strtok can cause such a bugging

  • @sukhendughosal6822
    @sukhendughosal6822 4 роки тому

    Nice explanation