[Proj] pj_init - C programming question

Martin Thierer thierer at web.de
Thu May 19 04:01:24 EDT 2005

On Wednesday 18 May 2005 21:03, Kevin S Lim wrote:
> Hi list,
> This is a C programming question.  If I wanted to populate the array of
> strings for parms_in, what would be the best approach to do so?  In other
> words, if you want to build parms_in and parms_out dynamically from two
> input ESRI PRJ files, what would be the best implementation?
> The reason I ask is b/c I started working with pointers (char **) and
> dynamic memory allocation, but ran into the problem that when parms_in is
> passed, it's the pointer and not the array of strings that is passed and
> hence the initialization always fails.

I'm not sure if I understand you, but this should work. If you make a constant 
array like shown in your code then what you get _is_ an array of char*. Maybe 
there's another reason why the initialization fails ?



> static char *parms_in[] = {
> 	"proj=lcc",
> 	"a=6378403.701",
> 	"rf=298.257222904",
> 	"x_0=152400.30480",
> 	"y_0=30480.06096",
> 	"lat_1=43.93n",	// first standard parallel
> 	"lat_2=44.37n",	// second stardard parallel
> 	"lat_0=43.85n",	// central parallel
> 	"lon_0=94.27w",	// central meridian
> 	"units=us-ft",
> 	"no_defs"
> };

More information about the Proj mailing list