--- sanofsans <[EMAIL PROTECTED]> wrote:
> Hi folks!
>
> This program is supposed to pass the variable "a" to
> the function
> "system" which then invokes the perl script
> 5678.pl. Spritf produces the correct string which I
> checked with
> puts(a), but the statement system("perl a");
> does not recognize the variable "a" as a variable!
> When I run the
> program, it displays:
> Can't open perl script "a": No such file or
> directory. Since "a" is a
> variable that changes when "i" changes, I need
> to change this program, and I just do not know how!
> Any suggestions!
> Thank you very much!!
>
> #include <stdio.h>
>
> void main()
> {
> int i=5678;
> char a[80];
> sprintf(a,"%i%s",i,".pl");
>
> system("perl a");
>
> /*puts(a); Display message correctly though*/
> return;
>
> }
>
>
Or you could adjust the sprintf to include the "perl "
and then pass the string a.
Mickey M.
Construction Partner Inc.
http://www.constructionpartner.com
____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html