问题 C++20 introduces std::format . What are the advantages over printf or std::cout . How can I use it and someone give an example of it? 回答1: What are the advantages over printf Type safety. For printf, the programmer must carefully match the format specifier to the type of the argument. If they make a mistake, the behaviour of the program is undefined. This is a very common source of bugs, especially for beginners. To be fair, decent compilers diagnose these mistakes as long as a constant