15 lines
594 B
HTML
15 lines
594 B
HTML
|
<p>
|
||
|
When you start a program, you can pass it some arguments.
|
||
|
We actually used this in this course sometimes before, to check your solutions.
|
||
|
But we never did show you how to access this arguments.
|
||
|
</p>
|
||
|
<p>
|
||
|
The main function gets passed two parameters. The first one is the number of arguments.
|
||
|
The second one is an array of strings. They are normally named argc and argv, but you can name them differently.
|
||
|
The first argument is always the path to your program.
|
||
|
</p>
|
||
|
<p>
|
||
|
Write a simple program, which checks, if any arguments got passed and
|
||
|
prints them in reverse order.
|
||
|
</p>
|