Split string with delimiters in C
How do I write a function to split and return an array for a string with delimiters in the C programming language? char* str = “JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC”; str_split(str,’,’); 25 Answers 25
How do I write a function to split and return an array for a string with delimiters in the C programming language? char* str = “JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC”; str_split(str,’,’); 25 Answers 25
My friend said that there are differences between “mod” and “remainder”. If so, what are those differences in C and C++? Does ‘%’ mean either “mod” or “rem” in C? 7 Answers 7
Why is it that scanf() needs the l in “%lf” when reading a double, when printf() can use “%f” regardless of whether its argument is a double or a float? Example code: double d; scanf(“%lf”, &d); printf(“%f”, d); 5 Answers 5
I am referring to the POSIX standard select and poll system C API calls. 3 Answers 3
This question already has answers here: How to convert an int to string in C? (11 answers) Closed 9 years ago. I tried this example: /* itoa example */ #include <stdio.h> #include <stdlib.h> int main () { int i; char buffer [33]; printf (“Enter a number: “); scanf (“%d”,&i); itoa (i,buffer,10); printf (“decimal: %s\n”,buffer); itoa … Read more
The standard predefined macro __FILE__ available in C shows the full path to the file. Is there any way to short the path? I mean instead of /full/path/to/file.c I see to/file.c or file.c 30 Answers 30
How do pointers-to-pointers work in C? When might you use them? 14 Answers 14
What actually is a C runtime library and what is it used for? I was searching, Googling like a devil, but I couldn’t find anything better than Microsoft’s: “The Microsoft run-time library provides routines for programming for the Microsoft Windows operating system. These routines automate many common programming tasks that are not provided by the … Read more
How should I use array of function pointers in C? How can I initialize them? 12 Answers 12