First Program

First program

hello.c

  • int: standard return type ➡️ void (return type not accepted by all the architectures)

  • (void): explicit parameter (best-practice) ➡️ () implicit parameter (alternative)

hello.c (command line version)

  • argc: number of strings specified in command line

  • argv: array of strings specifies in command line (separated by spaces)

Compilation

Execution

If you create the command line version of the code, you can specify several arguments. For example:

  • argc ➡️ 4

  • argv ➡️ ["./hello", "arg1", "arg2", "arg3"]

Comments

Last updated