Use standard function strcpy declared in header <string.h> that to copy a string in a character array
#include <string.h>
//...
char greeting[50];
strcpy( greeting, "Zack" );
There are other functions declared in header <string.h> that also can be used to copy strings in character arrays. For example
memcpy
strncpy
strcat
strncat
An example of using strcat instead of strcpy
#include <string.h>
//...
char greeting[50];
greeting[0] = '\0';
strcat( greeting, "Zack" );
Arrays have no the assignment operator. So the compiler issues an error for this code snippet
char greeting[50];
greeting = "Zack";
But there is a trick when you may assign character arrays. To do that you need to enclose a character array in a structure and use a compound literal. For example. Contrary to arrays structures have the assignment operator that performs member-wise copy of structure.
#include <stdio.h>
#include <string.h>
int main(void)
{
struct A { char greeting[50]; } s;
s = ( struct A) { "Zack" };
puts( s.greeting );
return 0;
}
The output will be
Zack
That this code would be compiled you need a compiler that supports C99.