read from command line c
snippet in c

int main(int argc char *argv ) in C

user922

int  // Specifies that type of variable the function returns.
     // main() must return an integer
main ( int argc, char **argv ) {
     // code
     return 0; // Indicates that everything went well.
}

c get arguments to main

user3387

int main(int argc, char *argv[]) { /* ... */ }

command line arguments c

user3290

int main(int argc, char* argv[]){/*...*/}

read from command line c

user3957

#include <stdio.h>

int main(int argc, char **argv) {
    for (int i = 0; i < argc; ++i) {
        printf("argv[%d]: %s\n", i, argv[i]);
    }
}

/*
	[birryree@lilun c_code]$ ./a.out hello there
	argv[0]: ./a.out
	argv[1]: hello
	argv[2]: there
*/