I am not so clear on character pointer and how they work.
The program builds, but crashes when I run it.
char *ab = NULL; //ab = \"abc123\"; // works f
"ab" is null and sprintf is trying to write to it, you have to allocate it first.
char ab[20]; sprintf(ab, "abc%d", 123); //
or
char * ab = malloc(20); // new, whatever sprintf(ab, "abc%d", 123); //