You don't always have to follow the rules cerin, I'll always help ya anyways.
> Could someone also explain to me what the stuff in the parentheses mean?int main(int argc, char *argv[])
argc = The number of arguements.
argv = The actual arguements
Try this exercise:
Code:
#include <stdio.h>
#include <stdlib.h>
int main(
int argc, // The number of arguements
char **argv ) // The arguement strings
{
// Loop through all of the arguements:
int i;
for( i=0; i<argc; i++ )
puts( argv[i] );
// Return success
return 0;
}
Output:
Code:
Shiva:/home/kleid/Programming/Laboratory# gcc argvargc.c -Wall
Shiva:/home/kleid/Programming/Laboratory# ./a.out
./a.out
Shiva:/home/kleid/Programming/Laboratory# ./a.out hello cerin how are you?
./a.out
hello
cerin
how
are
you?