469,307 Members | 1,583 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,307 developers. It's quick & easy.

C++ calling Perl program with parameters

hi all,

in our project we have to integrate perl and c++ program
we could succesfully call the perl program from c++ but
couldn pass the parameters .........
which are variables in c++........
how are the variables passed ...

system("perl ../perlbanking/new acctno 0 0 tot");

where in acctno and tot are c++ variables of type int...

thanks a ton in advance........
Aug 9 '07 #1
3 2900
numberwhun
3,503 Expert Mod 2GB
I would assume that, as in Perl, c++ would resolve the variables to their values prior to actually doing the call to the Perl script. That said and assuming it does so correctly, you would have to have your Perl script coded to handle command line options. Since we do not have access to your code, mostly because you did not post it here, we cannot see wheter it does or not.

Regards,

Jeff
Aug 9 '07 #2
miller
1,089 Expert 1GB
Perl provides access to command line parameters via the @ARGV array (perldoc perlvar). However, I do not believe that is directly relevant to your question. It sounds like you're asking how do you interpolate those C++ variables when calling perl via a command line interface. To learn that, you'll have to ask in the C++ Forum.

- Miller
Aug 10 '07 #3
thanks a lot that answers my question i could resolve it converting the parameters using strings i.e. int to char using sprintf
Aug 10 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

16 posts views Thread by palm | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.