Arguments

General discussions and chat

Arguments

Postby Vswe » Thu Jan 20, 2011 8:42 am

Your program must take 2 arguments:


How should I make my program take them? I mean, where does the verify program put the info for my program to read? I want to solve some puzzles but I can't...

/Vswe
User avatar
Vswe
 
Posts: 1
Joined: Thu Jan 20, 2011 8:25 am

Re: Arguments

Postby admin » Thu Jan 20, 2011 11:08 am

They are passed to argv in C#.
User avatar
admin
Site Admin
 
Posts: 333
Joined: Thu Dec 23, 2010 1:27 am

Re: Arguments

Postby snowball » Thu Jan 20, 2011 1:33 pm

Vswe wrote:
Your program must take 2 arguments:


How should I make my program take them? I mean, where does the verify program put the info for my program to read? I want to solve some puzzles but I can't...

/Vswe


In C/C++, basically your code will have format like this:

Code: Select all
int main(int argc, char * argv[])
{
// ...
}


if your program is named "testprogram", when you type for example
./testprogram 123 abc

your code will have argc filled as 3 and argv[0], argv[1], argv[2] filled respectively as "testprogram", "123", and "abc".

and this - I think - is also how verify program in server side would do.

HTH,
Matt
User avatar
snowball
 
Posts: 4
Joined: Mon Jan 17, 2011 6:47 pm

Re: Arguments

Postby Ariunbat » Mon Sep 12, 2011 1:15 am

what about in php? is it passed as string or as a file?
User avatar
Ariunbat
 
Posts: 2
Joined: Sat Feb 05, 2011 8:57 pm

Re: Arguments

Postby admin » Mon Sep 12, 2011 5:32 am

http://php.net/manual/en/reserved.variables.argv.php
Just echo the content of that variable and click verify, you'll see what is passed to your code.
User avatar
admin
Site Admin
 
Posts: 333
Joined: Thu Dec 23, 2010 1:27 am


Return to General

Who is online

Users browsing this forum: No registered users and 5 guests

cron