I tried with below code:
String hi = "hi"; String bye = "bye"; fprintf(fileout, "%d: %s, %s", 10, hi, bye); //fail fprintf(fileout, "%d: %s, %s", 10, "hi", "bye");//ok
however, this cannot write hi bye to the text file. What is wrong?
You need a "C string", which is a null-terminated character array (
Though C++ code will typically use the C++ I/O functions.
You don't normally want to use