mirror of
https://github.com/janishutz/eth-summaries.git
synced 2026-01-11 13:38:24 +00:00
17 lines
768 B
C
17 lines
768 B
C
// This is a line comment
|
|
/* this is a block comment */
|
|
#include "01_func.h" // Relative import
|
|
|
|
int i = 0; // This allocates an integer on the stack
|
|
|
|
int main( int argc, char *argv[] ) {
|
|
// This is the function body of a function (here the main function)
|
|
// which serves as the entrypoint to the program in C and has arguments
|
|
printf( "Argc: %d\n", argc ); // Number of arguments passed, always >= 1
|
|
// (first argument is the executable name)
|
|
for ( int i = 0; i < argc; i++ ) // For loop just like any other sane programming language
|
|
printf( "Arg %d: %s\n", i, argv[ i ] ); // Outputs the i-th argument from CLI
|
|
|
|
get_user_input_int( "Select a number" ); // Function calls as in any other language
|
|
}
|