How can I split up a string into whitespace-separated fields?
Answer / Rajeev Kumar Shukla
To split a string into whitespace-separated fields, you can use the `strtok()` function. Here's an example of splitting a string using `strtok()`:nn```cn#include <stdio.h>n#include <string.h>nnint main() {n char str[] = "This is a sample string";n char* token;nn // Tokenize the string using whitespace delimiters:n token = strtok(str, " ");n while(token != NULL) {n printf("%s
", token);n token = strtok(NULL, " ");n }nreturn 0;n}n```
| Is This Answer Correct ? | 0 Yes | 0 No |
hi, which software companys will take,if d candidate's % is jst 55%?
write an algorithm and a program to count the number of elements in a circularly singly linked list
Write a program which calculate sum of several number and input it into an array. Then, the sum of all the number in the array is calculated.
what do you mean by defining a variable in our c code?
write a program to arrange the contents of a 1D array in ascending order
what is the difference between while and do while?
What is 'bus error'?
What is the difference between exit() and _exit() function in c?
Is it better to use malloc() or calloc()?
Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.
any "C" function by default returns an a) int value b) float value c) char value d) a & b
Write a program to swap two numbers without using third variable in c?