Program C functions

C related functions

  1. Assign string to variable
Func Header Description
sprintf string.h assign format string to variable. sprintf(str, “%s %s\n”, s1, s2)
strncpy string.h copy string from a variable to another. strncpy(str, source, length)