strtok()
divides the string into tokens. i.e. starting from any one of the delimiter to next one would be your one token. In your case, the starting token will be from “-” and end with next space ” “. Then next token will start from ” ” and end with “,”. Here you get “This” as output. Similarly the rest of the string gets split into tokens from space to space and finally ending the last token on “.”
Related Posts:
- Split string with delimiters in C
- How to convert an int to string in C?
- What is a string of hexadecimal digits?
- How to convert an int to string in C?
- How to convert a string to integer in C?
- How do I create an array of strings in C?
- What is the difference between char s[] and char *s?
- How do I properly compare strings in C?
- How to convert an int to string in C?
- Returning string from C function
- How do I create an array of strings in C?
- Return char[]/string from a function [duplicate]
- How to check if a string is a number?
- How do I lowercase a string in C?
- Return char[]/string from a function
- How to clear all the elements of array in C?
- How do I concatenate const/literal strings in C?
- Reversing a string in C
- How to remove the character at a given index from a string in C?
- Allocating string with malloc
- Removing trailing newline character from fgets() input
- Does C have a string type?
- How does the strtok function in C work? [duplicate]
- Why do we use NULL in strtok()?
- Implementation of strtok() function
- How to concatenate string and int in C?
- The difference between char * and char[] [duplicate]
- Split string with multiple delimiters using strtok in C
- How to use execvp()
- How to use execvp() to execute a command
- What is *(uint32_t*)?
- Why should we typedef a struct so often in C?
- What is the difference between ++i and i++?
- Stack smashing detected
- Stack smashing detected
- How do I determine the size of my array in C?
- Why am I getting “void value not ignored as it ought to be”?
- Pointer Arithmetic
- Openssl : error “self signed certificate in certificate chain”
- What is the difference between C and embedded C?
- Parse (split) a string in C++ using string delimiter (standard C++)
- Difference between malloc and calloc?
- string to string array conversion in java
- segmentation fault : 11
- What are .a and .so files?
- So what does “return 0” actually mean?
- warning: assignment makes integer from pointer without a cast
- Why use bzero over memset?
- Split string with multiple delimiters in Python [duplicate]
- how to use uint64_t in C [duplicate]
- How do I solve the following errors: “Undefined reference to WinMain”, “[Error] Id returned 1 exit status”?
- Warning comparison between pointer and integer
- What is use of c_str function In c++
- Connect: Socket operation on non-socket
- How to correctly use the extern keyword in C
- what is the meaning of == sign?
- ARM Assembler – How do I use CMP, BLT and BGT?
- Invalid read of size 8 – Valgrind + C
- warning: incompatible implicit declaration of built-in function ‘xyz’
- strcpy vs strdup
- Warning comparison between pointer and integer in C language
- Why do I get clang: error: linker command failed with exit code 1?
- Difference between scanf() and fgets()
- How to convert integer to char in C?
- Is there a printf converter to print in binary format?
- Program received signal SIGPIPE, Broken pipe
- Difference between char* and const char*?
- How to read from stdin with fgets()?
- Output single character in C
- Does connect() block for TCP socket?
- Converting a C program to MIPS
- C: linker command failed with exit code 1
- What’s the equivalent of new/delete of C++ in C?
- sizeof float (3.0) vs (3.0f)
- How to trigger SIGUSR1 and SIGUSR2?
- What does “%.*s” mean in printf?
- Display value found at given address gdb
- Array definition – Expression must have a constant value
- Constant pointer vs Pointer to constant
- Variable warning set but not used
- Expected declaration specifier error in function
- strcmp not working
- Data argument not used by format strings in C
- error: aggregate value used where an integer was expected
- char pointers: invalid conversion from ‘char*’ to ‘char’?
- “Multiple definition”, “first defined here” errors
- how use EOF stdin in C
- Execution of printf() and Segmentation Fault
- Array type char[] is not assignable
- error: function returns address of local variable
- Return a `struct` from a function in C
- C: scanf to array
- What are “prototypes” in a C program?
- What’s the difference between “mod” and “remainder”?
- undefined reference to `std::ios_base::Init::Init()’
- previous declaration of ‘function’ was here in C [duplicate]
- Invalid write of size 1
- realloc(): invalid next size when reallocating to make space for strcat on char *
- How to Compare 2 Character Arrays [duplicate]
- error: `itoa` was not declared in this scope