sprintf的作用是将一个格式化的字符串输出到一个目的字符串中,而printf是将一个格式化的字符串输出到屏幕。 http://blog.csdn.net/sjf331/article/details/339254