Information

Author(s) Arthur van Stratum
Deadline Καμία προθεσμία
Submission limit No limitation
Category tags level1, s2, category_string

Ετικετές

Συνδεθείτε

[S2] Reading arguments

When you execute a C program, its function main() is called with, as parameters, the name of the program and the arguments after the executable's name.

The signature of the main() function must be the following :

int main(int argc, char **argv)

Write a complete C program containing a main. Your program should print one argument out of two (starting with the first), and return 0. Each argument shall be separated by a space, and the output shall be terminated by a new line just after the last argument printed (so without any additional space). Don't forget the required includes for your program.

Example :

./myProg a b c d e f g
a c e g