Welcome

C Programming Tutorial


C Programming Introduction

C language is a general-purpose programming language, It is not specilized to any particular area of application. You can build any type of applications using C Language. Most of the Operating Systems, such as UNIX, Windows, and Databases such as Oracle, MySQL, Sybase and SQL-Server etc., built using C Program language.

int main()

main method takes zero arguments and returns integer value

int main(int argc, char *argv[])

argc is number of command-line arguments ,argv is array of pointers to char that can be thought of as array of strings.
argv[0] is executable name


// args.c

int main(int argc, char* argv[])
{
	printf("Number of Arguments=%d\n",argc);

	for(int i=0; i < argc; i++){
		printf("argv[%d] =%s\n",i,argv[i]);
	}
	
	return 0;
}
compile: cc -o args args.c
Execute: ./args Johney learning C programming language
Output:
Number of Arguments=6
argv[0] =./args
argv[1] =Johney
argv[2] =learning
argv[3] =C
argv[4] =programming
argv[5] =language

ADS