C语言的函数

C的函数

  1. 把字符串赋值到变量中
函数头文件描述
sprintfstring.h把格式化的字符串赋值到变量中. sprintf(str, “%s %s\n”, s1, s2)
strncpystring.h把别的变量的字符串赋到变量中. strncpy(str, source, length)