|
Posted by bob.chatman@gmail.com on 01/31/07 04:56
On Jan 29, 2:21 am, Ruben van Engelenburg <nos...@nospam.com> wrote:
> balakrishnan.din...@gmail.com wrote:
> > hi frndz,
>
> > As we know that, we can pass command line agrument for C using
> > "scanf" commands, So as same as that, Is there any way to pass those
> > commandline arguments through php code to C and process them. If there
> > plz soon, or tel me any alternative for this
>
> Hi Dinesh,
>
> I'm not sure what you mean, because in C you don't use scanf to retrieve
> commandline arguments. You use scanf to get user-input. You use the argc
> and argv arguments in main() to access commandline arguments.
> In PHP you have similar variables: $argc and $argv. $argc holds the
> number of arguments and $argv is the array containing the values.
>
> HTH.
> Ruben.
What he passed you is a command forwarded to the command line of your
server. its exactly the same as if you were to go:
yourprogram -n 1234
Your program would have ARGC = 2 and ARGV would be {"-n", "1234"}
it has nothing to do with the scanf or anything like that.
[Back to original message]
|