//--------------------------------// -----------------------------------#include stdio.h#include math.h

编程学习网为您整理以下代码实例,主要实现:C语言库sprintf()函数,希望可以帮到各位朋友。

//--------------------------------
// -----------------------------------
#include <stdio.h>
#include <math.h>

int main () {
   char str[80];

   sprintf(str, "Value of Pi = %f", M_PI);
   puts(str);

   return(0);
}