Overview

General purpose programming language

In the past, languages were used for specific purposes, such as FORTRAN for calculations, COBOL for business-oriented applications.

C is a general usage imperative programming language.

The History of C

What does it provides?

>The Standard C

<aside> 👉 C89

</aside>

<aside> 👉 C99

</aside>

<aside> 👉 C11

</aside>

>Working With Larger Programs

Fundamentals Of C

>Mind Map of the Basics

>Basic Structure of a C program

#include <stdio.h> //preprocessor directives
#include <otherLibrairies>

int main()  //main function initialisation, everything inside will be executed. Must be used only once
{
	printf("My name is Rohit");  //statements  // { } are terminal points of a function, and inside them is blocks of code
	return 0;
}

>Comments

- Used to document our code
- Extraneous comments are bad, avoid them.

Single Line Comment
//This is a single line comment

Multi-line comment
/* This is a 
multi
line 
comment
*/

>Escape Characters

char x = '\\n'; 

Untitled

Preprocessors and Headers

>Pre-Processing

>Header Files

>The include preprocessor directive

A pre-processor directive, which instructs the compiler (#include <header.h>) to include the contents of the header library in our program.

/* < > tells the compiler to look for this 
file in directories defined by $PATH*/
#include <stdio.h>

/*Used to include user-defined libraries, 
Tells the compiler to look for a header file in the current directory*/
#include "stdio.h"

The basic Important Stuff