Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site alice.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: net.lang.c Subject: Re: Function returning pointer to function Message-ID: <4029@alice.UUCP> Date: Sat, 20-Jul-85 11:36:42 EDT Article-I.D.: alice.4029 Posted: Sat Jul 20 11:36:42 1985 Date-Received: Mon, 22-Jul-85 06:23:45 EDT References: <635@kvvax4.UUCP> Organization: Bell Labs, Murray Hill Lines: 19 > char cd[2] = {'c','d'}; > char (*pcd)[] = cd; > /* "junk.c", line 55: warning: illegal pointer combination */ > /* What is it that the compiler (4.1 BSD) doesn't like? */ Well, let's see. You are saying that pcd is a thing such that if you dereference it and the subscript it, you get a char. In other words, pcd is a pointer to a pointer to a char. cd is a pointer to char, so you can't assign it to pcd. Now, if you had said: char cd[2] = {'c','d'}; char *pcd[] = {cd}; you are now saying that you can subscript pcd and then dereference it to get a char. Thus pcd is an array of pointers to chars; the length of the array is given by the initialization to be 1.