sprintf(&buffer[7],"%f",value);和sprintf(buffer,"%f",value);如何理解啊?

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/09 09:38:08

sprintf(&buffer[7],"%f",value);和sprintf(buffer,"%f",value);如何理解啊?
sprintf(&buffer[7],"%f",value);和sprintf(buffer,"%f",value);如何理解啊?

sprintf(&buffer[7],"%f",value);和sprintf(buffer,"%f",value);如何理解啊?
sprintf(&buffer[7],"%f",value)是将value值输出到buffer的第8位开始,例如buffer = 'aaaaaaaaaa',value = 1.1,那结是就是buffer = 'aaaaaaa1.1'.
sprintf(buffer,"%f",value)是从第一位开始输出,value值为几位,几位后结束‘\0’.