Parameters passed to the main function

Nasza ocena:

3
Wyświetleń: 462
Komentarze: 0
Notatek.pl

Pobierz ten dokument za darmo

Podgląd dokumentu
Parameters passed to the main function - strona 1 Parameters passed to the main function - strona 2

Fragment notatki:

Parameters passed to the main function int main(int argc, char *argv[]) • argv[0] is the name by which the program was invoked ( argc is at least 1) • If argc is 1, there are no arguments • In the example: echo.exe hello, world • argc is 3 • argv[0] is " echo.exe " • argv[1] is " hello, " • argv[2] is " world " • The first optional argument is argv[1] and the last is argv[argc-1] • After the last regular pointer, there is additionally argv[argc] : a null pointer ... zobacz całą notatkę



Komentarze użytkowników (0)

Zaloguj się, aby dodać komentarz