<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>pj_init - C programming question</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Hi list,</FONT>
</P>
<P><FONT SIZE=2>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?</FONT></P>
<P><FONT SIZE=2>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.</FONT></P>
<P><FONT SIZE=2>Any input is welcome. Thanks in advance.</FONT>
</P>
<P><FONT SIZE=2>-- Kevin</FONT>
</P>
<P><FONT SIZE=2>=====================================</FONT>
</P>
<P><FONT SIZE=2>static char *parms_in[] = {</FONT>
<BR> <FONT SIZE=2>"proj=lcc",</FONT>
<BR> <FONT SIZE=2>"a=6378403.701",</FONT>
<BR> <FONT SIZE=2>"rf=298.257222904",</FONT>
<BR> <FONT SIZE=2>"x_0=152400.30480",</FONT>
<BR> <FONT SIZE=2>"y_0=30480.06096",</FONT>
<BR> <FONT SIZE=2>"lat_1=43.93n", // first standard parallel</FONT>
<BR> <FONT SIZE=2>"lat_2=44.37n", // second stardard parallel</FONT>
<BR> <FONT SIZE=2>"lat_0=43.85n", // central parallel</FONT>
<BR> <FONT SIZE=2>"lon_0=94.27w", // central meridian</FONT>
<BR> <FONT SIZE=2>"units=us-ft",</FONT>
<BR> <FONT SIZE=2>"no_defs"</FONT>
<BR><FONT SIZE=2>};</FONT>
<BR><FONT SIZE=2>if ( ! (ref_in = pj_init(sizeof(parms_in)/sizeof(char *), parms_in)) ) {</FONT>
<BR> <FONT SIZE=2>//bail out...</FONT>
<BR><FONT SIZE=2>}</FONT>
</P>
</BODY>
</HTML>