In my C program, I am printing a string to the command terminal using printf("%d %s %s\n", node->id, node->date, node->input); but I need to now use the write function write(STDOUT_FILENO, cmdline, strlen(cmdline));…
How can I format the string like I did using printf?
Use
sprintf/snprintfto format the string into a character buffer, and thenwritethat.