ways to define a string in C:
the first and second examples above can also have strcpy() used on them, but not outside of the space you have to work with! otherwise you'll be reaching into memory that's not yours.
char foobar = "Hello";
char foobar = "Hello"; // note 6 not 5, last is for null terminator
char *foobar = "Hello"; // set at initialization - is ok
foobar = (char *) malloc (6); // allocate space
strcpy (foobar, "Hello"); // after initialization you must use string functions to change strings
free (foobar); // anything malloc()ed must be free()d after you're done with it
the third example above should not be modified after initalization (thanks hammer).
god i hope that's all right (it looks right to me) otherwise i'm gonna feel sofa king dumb
foobar = (char *) malloc (strlen ("Hello") + 1); // strlen returns the size of the inputted string
strcpy (foobar, "Hello");
free (foobar); // always free after your done using it, never free before