You are here: Re: how to pass commandline argument to C program from PHP code « PHP Programming Language « IT news, forums, messages
Re: how to pass commandline argument to C program from PHP code

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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация