Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Jun 2009 20:41:28 -0400
From:      Robert Huff <roberthuff@rcn.com>
To:        questions@freebsd.org
Subject:   OT: C syntax question
Message-ID:  <19017.24376.343126.389436@jerusalem.litteratus.org>

next in thread | raw e-mail | index | archive | help

	Let us suppose I have a structure:

struct CONTINENT {
	...
}

	I use this to create an array of pointers to said struct:

struct CONTINENT *Asia[10][10];

	Now I pass this array to a function:

	plate_shift(Asia, (int) foo, (float) bar);

	In the definition of the function, I say:

int plate_shift(Cont,f,b)
	struct CONTINENT *Cont[10][10];
	int f;
	float b;
{
	...
}

	and the compiler does not complain.  If, however, I try to
prototype the function as:

  extern int plate_shift(struct CONTINENT *[][],int,float);

	with:

CFLAGS = -Wall -std=c99

	I get:

error: array type has incomplete element type

	Changing to:
	
  extern int plate_shift(struct CONTINENT *foo[][],int,float);

	returns the same error.
	K&R 2ed is not helpful, nor is a quick poke around the web.
	What am I forgetting?

	Respectfully,


				Robert Huff




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19017.24376.343126.389436>