Question 8.3

If I can say

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


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

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

See also questions 1.32, 4.2, and 7.2.


Read sequentially: prev next up top


This page by Steve Summit // Copyright 1995 // mail feedback