prev up next   top/contents search

comp.lang.c FAQ list · Question 8.3

Q: If I can say

	char a[] = "Hello, world!";
why can't I say
	char a[14];
	a = "Hello, world!";

A: Strings are arrays, and you can't assign arrays directly. Use strcpy instead:

	strcpy(a, "Hello, world!");

See also questions 1.32, 4.2, 6.5, and 7.2.

prev up next   contents search
about this FAQ list   about eskimo   search   feedback   copyright

Hosted by Eskimo North