#include<cstdio>
#include<cstdlib>
#define MAX 400
int main(void)
{
      char buff[MAX]
      int a,b;
      int arc1 = 10;
      sprintf(buff,"./FirstProg %d",arg1); 
      //use %s insted of %d if the arg is a string

      for ( a=0;a<10;a++)
      {
          system(buff);
          //Arg1 should be a
      }
}

BTW, Howz Anna Univ doing ? I am an alumini.

--- In [EMAIL PROTECTED], com bio <[EMAIL PROTECTED]> wrote:
> 
> Hello,
>   Please look at the following C++ program.
> 
> #include<cstdio>
> #include<cstdlib>
> int main(void)
> {
>      int a,b;
>      for ( a=0;a<10;a++)
>      {
>          system("./FirstProg <Arg1> ");
>          //Arg1 should be a
>      }
> }
> 
> now the first argument <Arg1> to the program FirstProg
> is dynamic and will change.so how do i call the system
> command with a dynamic argument.
> 
> how do i do this?
> thanks and regards
> Deepan Chakravarthy N
> 
> =====
> link to deepan's home page: 
http://www.geocities.com/combiofriends/deepan.html
> 
> -------------------------------------------
> center for biotechnology
> anna university
> chennai-25
> india
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/EbFolB/TM
--------------------------------------------------------------------~-> 

>-----------------------------------------~-~>
CHECK THE ARCHIVE BEFORE POSTING!!!! Archive is available at 
http://www.eScribe.com/software/C-Paradise/

>------------------------------------------_->


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/C-Paradise/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to