We must use the standard library function strcpy to copy the string constant into the variable.
To initialize the variable name to Sam.
#include <string.h> int main() { char name[4]; strcpy(name, "Sam"); return (0); }