Programming in C - The Complete Course
4.5 (23 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
1,784 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Programming in C - The Complete Course to your Wishlist.

Add to Wishlist

Programming in C - The Complete Course

For the future programmers
4.5 (23 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
1,784 students enrolled
Created by Anand Mahajan
Last updated 4/2017
English
English
Curiosity Sale
Current price: $10 Original price: $20 Discount: 50% off
30-Day Money-Back Guarantee
Includes:
  • 8.5 hours on-demand video
  • 95 Supplemental Resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • The students will start solving programming problems. They will be in a position to pursue their courses in advanced languages and technologies like C++ , Java , Android , iOS, PHP, Python etc.
  • This will enhance students' understanding with regard to the way software applications are developed. The students will definitely develop a huge interest in programming and software development.
View Curriculum
Requirements
  • The only prerequisite is the ability to handle very basic operations of a computer although no prior experience in programming is required. Download any free IDE (Integrated Development Environment) for C language like Dev-C++ - Bloodshed, Code::Block, Netbeans etc. These softwares are used to write and execute your C (C++ also) programs. All of them are free. Just google and download from their official websites. Dev-C++ - Bloodhsed is highly recommended as I used it in the whole course.
  • Be prepared to take notes of the programs I explain, on a paper notebook before writing the programs directly on your computer. This is a great and proven method to learn programming. Please do away with copy and paste habit while undergoing this course.
Description

This course is guaranteed to make the students fall in love with programming. Easy to learn methodology used by a seasoned teacher who has been teaching programming in different computer languages for the last 20+ years.

Flood gates for a lucrative career in programming are certain to open for those Who undergo this course diligently and passionately.

I assure you that if you complete this course it will pave a way for you to become a consummate programmer as all the advanced programming languages and technologies are based on C only. There won;t be any looking back once you immerse yourself with all the contents.
In future I will be posting assignments also . I will come up with more courses like Java and PHP etc.

My humble advice:  
Write all the programs by yourself typing. Make changes here and there and see the changes in output. Play with the code. Don't get discouraged with errors as they are your teachers. 


Who is the target audience?
  • Anyone who wants to make a career in programming and knows that once he/she is comfortable with C language programming there won't be any looking back.
  • Engineering students , Computer science students pursuing their graduation and post graduation degrees
  • This course is also suitable for school students who have an urge to become programmers.
Students Who Viewed This Course Also Viewed
Curriculum For This Course
79 Lectures
08:18:53
+
Listen in before you take a plunge
2 Lectures 05:09

All the students are extremely curious about the teaching experience of the instructor who is going to teach them. This lecture will reveal the profile , teaching experience and passion of your instructor. Anand Mahajan  has the privilege of training thousands of students during his scintillating  career spanning over 25 years. His passion to explain the things in an easy-to-grasp manner has been applauded by many old and new students who are working in the IT industry across the globe. He has the experience of working with two giant Indian computer education companies as senior faculty.

Preview 01:50

I have left no stone unturned to make this course the best in the market. But my extremely serious advice to learners - Write the programs on your own. The only way to learn programming is by writing , trying , modifying the code. Errors and their removal will definitely ibring the best in you. This course will teach you from basics upto some advanced topics.Starting from scratch you will learn what a programming language is. You will move on to learn data types , variables , programming construct (sequence, selection and iteration) , working with arrays (single and double dimensional) , how to develop your own functions,pointers, pointer arithmetic, representation of arrays through pointers,structures with and without pointers, file handling etc. All the topics are explained with the help of slides followed by appropriate example programs. I will keep uploading more lectures once this course kick off. suggestions and criticism will be received with thanks as this will help me to strive more to make this course more useful.  

Preview 03:19
+
Having the first brush
3 Lectures 17:04

A program is in fact a set of instructions i.e. programming statements. Programming languages are a medium to write these programs. Three type of categories are there for programming languages - 

1)  Machine language 

2)  Assembly languages

3)  High level languages

  • Machine language program is directly machine readable hence needs no conversion.
  • Assembly language is a compromise between machine language and high level language. Even though these programs do not use machine codes but use a special symbols called mnemonics. In order to convert an assembly language program into machine language we need assemblers. 

The program written by the programmer in a high-level language is termed as 'Source program' which passes through the stages of pre-processing, compilation , linking and loading. The source program written in a high-level language is in an English like language. The compilation of the source program is a must as it converts into machine language which is understandable to the computer machine.There are two translation techniques to convert a high-level language program -

  1. Interpreters
  2. Compilers


Preview 04:17

A program is essentially made up of functions. A function is a subprogram that performs logically isolated task.Function main() happens to be the entry and exit point of the program. Library functions are the in-built functions that come with the language software itself and user-defined functions are developed by the programmers themselves. 

An IDE (Integrated Development Environment) is the software that provides all the facilities of writing , editing , compiling and executing the program under one umbrella.

Structure of a C program
03:45

This lecture contains explanation of character set of c language. Various types of tokens (constants,variables,keywords,operators) , data types in C language and a brief description of formatted and unformatted input out functions.

  • A character set is nothing else but all the characters put together which will be used while writing a C program. 
  • Any  programming statement is made up by using tokens (constants, variables, keywords and operators).
  • There are 32 keywords in C language. They cannot be used as variable names.

C is a strongly typed language. That means a variable has to be declared in C language before using it. At the time of declaration data type has to be mentioned. Various data types supported in C are - int,unsigned int,long int , unsigned long int, float, double, long double, char. 

Character set, tokens, Data types, I/O library functions
09:02
+
Sample programs to get you going
6 Lectures 43:33

printf() and scanf() library functions present in the header file stdio.h are indispensable functions for almost all the C programs. Header files are just collections of declarations of library (in-built) functions and macros.There are large number of header files provided in C e.g. stdio.h, conio.h, math.h, stdlib.h, process.h, ctype.h, string.h, graphics.h etc.

C Programmers use printf() for generating a formatted output on the output screen. They use scanf() for reading the values from the user. To read means to input.

Format specifiers are sort of codes like %d(%i), %f, %ld(%li), %lf, %Lf, %c, %s, %lu, %u, %x, %o etc. which are to be used with printf() and scanf(). They come in handy while formatting the output. 

Formatted I/O functions printf() and scanf()
10:01

1) Comments also known as remarks are used to show some lines in your code that explain the task you are doing. C compiler is going to simple ignore comments and remarks at the time of compilation. The purpose of writing comments is just to let a reader of your program know what is happening in this part of the code. They are not meant to be for users as they won't yield any output. Even though it's not necessary to give comments but they  come in handy for the learners and other programmers who are perusing your program.

// is used to write a 'single line' comment whereas multiple lines comments are enclosed within /* and */.

2) Escape sequences are used mostly within the printf() statement and are used to produce some kind of effects on your output. e.g. \n will show the output on the next line. 

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Preview 07:59

A very important fact about printf() statement is - whatever we write within double inverted commas (") that is printed as it is except format specifiers and escape sequences. e.g. 

1) printf("Meditation course will cost you $%d",fee) ;    // here fee is assumed to be an int variable

In the above statement "meditation course will cost you $" will be printed as it is as there is no format specifier or escape sequence but in place of %d value of variable fee will be printed. 

let us assume value of variable fee is 25, then output will be -

meditation course will cost you $25.

2) printf("Company is on the hiring spree") ;

output:

Company is on the hiring spree.

3) printf("The following temperatures have been recorded through the day - %f\n%f\t%f",temp1,temp2,temp3) ;

output:

The following temperatures have been recorded through the day -

12.400000

14.500000                  16.880000


above are just the assumed values of float variables temp1, temp2, temp3.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Second Sample Program
06:04

printf() function is pretty powerful as far as formatting the output goes. e.g. 

  • printf("%10d",x) ;  // assumed value of x is 25

The output will be :        

        25

%10d will reserve 10 columns and if the number happens to be having number of  digits less than 10 , then value will be right aligned. So 25 was printed after leaving 8 blank spaces.

  • printf("%-10d",x) ;  // will make the value left aligned. 8 spaces will be left on the right side.
  • printf("%.2f",y) ;  // assumed value of  y is 12.831458

 The output will be:

12.83    


Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Formatting output
07:46

Type casting comes in handy when we evaluate expressions involving different data type values. Let me explain the whole idea behind type casting -

By default when an arithmetic operator (+, -, *, /, %)  is applied on two values of the same data type then this yield the output of same data type.That means int and int operands will yield int result, float and float operands will yield float results and so on. 

  1. Implicit type casting
    When an arithmetic operator is applied on operands of two different data types, result belongs to the higher data type between the two.  Actually data type of the operand with lower data type is promoted to the higher data type. e.g. operation on an int and a float operand will give float result as float data type is bigger.
  2. Explicit type casting
    Sometimes both the operands belong to the same data type but we want to have the output with a different data type. Here explicit type casting comes in handy.

e.g. 

int a=10,b=7;

float c ;

c=a/b ;   // only integer part that is 3 will be produced and assigned to c as a and b both have int data type

but we want to have the output as a float value so that it can be accommodated by float variable c. So following trick that uses explicit type casting will do the job -

c=(float)a/b ;      // a being type casted as float

or

c=a/(float)b ;      // b being type casted as float


Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Preview 04:24

Two more sample programs with complete explanation to enable students consolidate their understanding in the topics discussed so far.

  • First program reads principal amount, rate of interest and time from the user and then calculates the simple interest. Thereafter it uses printf() formatting feature to display the output.
  • Second program reads marks of a student in 3 subjects and then calculates and prints the percentage in a formatted way. Type casting is  also used.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

More Sample programs
07:19
+
Operators in C language.
5 Lectures 27:58

1) operators are symbols that tell the computer what operation is to be performed on operands. Operands mean variables and constants.

e.g.

See the following in the expressions - 

  • x+y     here + is the operator applied on operands x and y (variables).
  • 100-4  here - is the operator applied on operands 100 and 4 (constants).
  • 50*6    here * is the operator applied on operands 50 and 6 (constants).
  • k>90    here > is the operator applied on operands k(variable) and 90 (constant).

2) In this lecture I have discussed the following categories of operators. This categorisation is based upon the type of operations these operators do.

  • Arithmetic operator
  • Relation operators
  • Logical operators

In the nest lecture we are going to learn more operators.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Operators in C language - Part I
07:02

Types of operators ( based upon the number of operands )-

1) Unary Operators         

These are the operators in which only one operator is used.

2) Binary operators

Thses are the operators which use two operands.

3) Ternary operators (conditional operator)

There is only one ternary operator i..e ?: . It operates on 3 operands.

All the above have been explained fully with appropriate examples in this lecture.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Operators in C language - Part 2
09:07

Compound  Assignment operators 

+=

-=

*=

/=

%=

In the lecture all these compound assignment operators have been explained in full detail along with example code.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Operators in C language - Part 3
03:40

Precedence and Associativity :

When there are multiple operators in an expression then C has a predefined rule of priority for the operators. e.g. in the following expression * will take place first and then + as * has higher precedence than +.

d=a+b*c ;

Watch this lecture fully to have the complete understanding of precedence.

Please see the description and video of next lecture to know about associativity of operators.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Precedence and Associativity of operators - Part I
04:31

We do have many instances whereby many operators have the same precedence level. In that case Associativity plays it's role.when two or more operators bearing the same precedence level appear in a n expression. Associativity is either left to right or right to left.  e.g. in the follow expression sub expression a*b will be evaluated first as * and / have the same precedence level but their associativity is left to right. Afterwards / will operate. + and - have the same precedence level but lower than * and /. Their associativity is also from left to right. Hence - will operate first than +.    

d=a*b/10-25+100 ;

I have provided a table of precedence associativity of all important operators in C.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Precedence and Associativity of operators - Part 2
03:38
+
Sequnce construct and all about if statement programming construct
7 Lectures 39:35

Programming constructs (Control structures) :

They are the building blocks of any program. Basically there are 3 types of constructs -

1) Sequence                                         2) Selection (decision-making)                               3) Iteration (loops)

In this lecture I have explained sequence construct with the help of an example. In this example program you will also get to learn more about header files as I have used math.h. This header file contains some useful mathematical function like sqrt() , pow() etc.

In sequence construct all the statement are executed one after another in a sequential manner without skipping or repeating any statement(s).  

Note: Do write all the programs yourself. Then make changes here and there and re-execute.


 

Programming constructs in C - General concept
06:25

If statement (selection construct) :

if statement is very powerful yet simple decision making statement. Using this programmer tests a condition. If condition is true a particular action is taken otherwise some other action is taken. By action I mean a statement or a set of statements.

You will learn using simple if statement and then using if statement with else.

The whole concept will come clear to you as it has sample program with detailed explanation.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Programming constructs in C - Using if and if..else statement (Part I)
09:27

Nested if : (Part I)

The presence of an if within another if is termed as "nested if". This is required when a condition comes out to be true and we want to test another condition.

The else of inner if appears first and that of outer if later.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Programming constructs in C - (using nested if) Part 2 (a)
06:14

This lecture just contains another sample program that will consolidate your concept about nested if.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Programming constructs in C - (using nested if) Part 2 (b)
03:16

In the previous lecture we discussed a program involving nested if. It calculated biggest among 3 numbers.

In this lecture we will use an alternative way to write that program by using && (conjunction operator) logical operator.

Alternative to nested if
03:25

if .. else .. if ladder

This offshoot of if construct is hugely useful. This mainly comes in handy when we want to write programs that offer a solution for value range problems..
e.g if I want to calculate income tax (IT) as per the following slabs -

if  income is more than or equal to 10000 then IT is 45%

if  income is between the range   >=5000 and <10000 then IT is 30%

if income is between the range >=2000 and <5000 then IT is 20% 

if income is <2000 then IT is 10%

Ladder will go like this -

if (income>=10000)

IT=45.0/100*income ;

else

if (income>5000)

IT=30.0/100*income ;

else

if (income>2000)

IT=20.0/100*income ;

else

IT=10.0/100*income ;


Please refer to the programs explained in the lecture.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Programming constructs in C - (using if..else..if ladder) Part I
07:10

 Alternative way to handle if..else..if ladder :

  • Recall  the example in the description of the previous lecture -

if (income>=10000)

IT=45.0/100*income ;

else

if (income>=5000)

IT=30.0/100*income ;

else

if (income>=2000)

IT=20.0/100*income ;

else

IT=10.0/100*income ;

  • The same could be written without using if..else..if ladder as follows -

if(income>=10000)

IT=45.0/100*income ;

 if(income>=5000 && income<10000)

IT=30.0/100*income ;

 if(income>=2000 && income<5000)

IT=20.0/100*income ;

if (income<2000)

IT=10.0/100*income ;

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Programming constructs in C - (Alternative to if..else..if ladder) Part 2
03:38
+
Switch case construct
2 Lectures 16:20
switch case Part - 1
08:50

switch case Part - 2
07:30
+
Iteration construct (Loops)
6 Lectures 31:34

What are loops ? 

Loops are used for executing one or more statement repeatedly. A condition is tested and loop statements keep executing as long as this condition turns out to be true.There are 3 types of loops -

1) while loop   (pre-tested)

2) do..while loop (post-tested)

3) for loop  (pre - tested)

In pre-tested  loops first the condition is tested only then loop statements are executed if condition is true.

In post-tested loop first the loop statements are executed only then condition is tested.

Post-tested loop statements are executed at least once.

The subsequent lectures will take you on an interesting journey into loops. A lot of examples will facilitate quick and tenacious learning. 


Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Introduction to loops
02:55

while loop (pre-tested loop) :

In this kind of loop first condition is tested and if it's true then control enters into the loop. Remember if there are more than one loop statements they have to be enclosed within a curly braces block i.e. { }.Otherwise in case of single loop statement it is optional.

This lecture will explain the whole process in a very simple manner.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

while loop in action
06:02

do..while loop(post-tested loop) :

It is a post tested loop in which first loop statements are executed and only after that condition is tested. Remember if there are more than one loop statements they have to be enclosed within a curly braces block i.e. { }.Otherwise in case of single loop statement it is optional.

Always remember in such kind of loop , loop statements are executed at least once.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

do..while loop in action
05:45

for loop (pre-tested loop):

It won't be exaggeration if I say that for loop is the most popular loop among programmers. It has 3 components -  

1) initialisation(s)

2) condition(s)

3) increment or decrement statement(s)

Watch the video lecture which explains the whole working step by step.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

for loop in action - Part I
04:04

In this lecture you will learn different ways for loop can be applied. You will learn the behaviour of for loop when it is terminated with a semi-colon(;) and when it is not. 

You  will understand the working of for loop when multiple statements are written in the la ast component of for loop. You will have a fair idea of how we can skip initialisation component. In fact all the 3 components of loop are optional.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.


for loop in action - Part 2
07:19

This lecture will teach you how we can use multiple statements in all the 3 components of for loop  viz. initialisation, condition and increment/decrement part.

Every aspect has been elucidated in a very easy-to-understand manner. 

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

for loop in action - Part 3
05:29
+
Honing the programming skills using loops
5 Lectures 39:26

This lecture will show you how to write some simple programs using loops like printing odd,even series using all 3 types of loops. This will brush up your knowledge further about loops and their working.

You will also write and execute a program that prints the mathematical table of a number in a proper format.

 Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Sample loop programs - Part I
10:09

In this program user will read (input) a number and program will calculate it's factorial. As you know if want to calculate the factorial of a number n , then following method is applied -

n * (n-1) * (n-2) * (n-3) * ............* 2

e.g. if n=7 , then -

7 * 6  * 5 * 4 * 3 * 2       and output will be 5040.

Program has been explained with the help of a dry test (dry run). A dry run is just a simple table whereby we display the changing values of variables used in the loop. 


  •  Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Sample loop programs - Part 2
05:26

This is yet another program that will take you further in understanding the logic build up using loops. In this program a number will be read by the user and it' reverse will be calculated.

The logic is quite straight forward. Get the remainder of this number by dividing it with 10 using modulus operator %. Print it and get the integer quotient of this number by dividing it with 10.Update the value of this number with this quotient. Go on round the loop until the number becomes zero.

The whole logic has been elaborated with the help of a dry test in the video. 

  •  Note: Do write all the programs yourself. Then make changes here and there and re-execute.
Sample loop programs - Part 3
06:01

Nested Loops : 

A loop within a loop is called nested loops. Always remember - for each turn of outer loop inner loop is executed some specified number of times.

In this lecture I have explained this concept with the help of an example. In this example user will read 2 numbers - starting number a and ending number b. Our program will print mathematical tables of all the numbers within this range.

 Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Nested Loops - Part I
09:30

To practise nested loops here is another sample program with full explanation about it's logic.

Here we will learn how to display some patterns using numbers or particular symbols like *. I will be uploading some more such sample programs.

 Note: Do write all the programs yourself. Then make changes here and there and re-execute. 

Preview 08:20
+
The concept of arrays and their programming
10 Lectures 01:18:59

Arrays:

An array is a finite set of homogeneous elements stored in contiguous memory locations. Homogeneous elements are the values belonging to the same data type.

An array has to be declared before it's use.

e.g.    The following declaration is allocating the space for 10 int elements in the memory 

int arr[10]  ;           

as an int takes up  4 bytes in the memory total 40 bytes will be reserved in contiguous memory locations.

Moreover we can initialise array elements at the time of declaration.

e.g.

double values[ ]={1000.99,9000.85,1000.15} ;

In the above statement array space for 3 double data type elements will be reserved such that first element values[0] is assigned 1000.99 , second element values[1] is assigned 9000.85 and so on.

You will learn some other important issues also.

The basic concept of arrays
08:27

Traversal of array elements :

As there are multiple elements in an array it's not feasible to traverse them without using a loop. Any of the 3 types of loops can be employed to traverse the array elements one by one. This lecture will show you the whole process whereas array elements are being read(inputted) , printed and processed. 

Note: Do write all the programs yourself. Then make changes here and there and re-execute. 



Traversal of array elements - Part 1
06:30

Another example program to learn how to traverse array elements.

Note: Do write all the programs yourself. Then make changes here and there and re-execute. 

Traversal of array elements - Part 2
04:39

In this lecture you will learn how the size of an array can be decided by the user and not the programmer.

e.g.

suppose we want to declare an array arr with the size n. The value of variable n will be read from the user.

double arr[n] ;       // here size n is NOT a constant but a variable 

A Word of Caution :

Some C/C++ compilers (outdated ones) like Turbo C/C++ do not allow to use a variable as the size at the time of array declaration.

Note: Do write all the programs yourself. Then make changes here and there and re-execute. 

Traversal of array elements - Part 3
11:02

Bubble Sort :

There are innumerable usages of arrays including -

1) Sorting  ->    This technique is used to arrange array elements either in ascending order or descending order.

2) Searching -> This is the programming technique in which a particular value is searched (found) among the array elements.

In this lecture you will learn the whole logic applied in applying bubble sort. The logic has been explained with the help of diagrams. You will also learn about interchanging (swapping) of values of two varaibles or array elements.

In the very next lecture I will show and explain the program of bubble sort. 

Preview 08:58

In this lecture I have shown and explained the program of bubble sort. In almost all sorting techniques the whole process involves nested loops. Outer loop takes care of passes and inner loop handles the comparisons.

A pass is nothing else but one of the various stages (phases) that the bubble sort passes through, 

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Sorting techniques : Bubble sort Part - 2
07:03

Double Dimensional arrays (2-D arrays) 

A 2-D array is just a matrix with some specified number of rows and columns. we can safely say that a 2-d array is a collection of many 1-d arrays,

They come in handy when we want to  register multiple entries for some entities. Suppose we want to store marks of 5 students in 3 subjects each, then we will work using a 2-d array that has 5 rows and 3 columns. Rows will represent students & columns marks.

while traversing a 2-d array we apply nested loops , outer loop representing rows and inner loop columns.

The whole procedure has been explained with the help of an example.

Note: Do write all the programs yourself. Then make changes here and there and re-execute. 

Double dimensional arrays Part - 1
08:56

This lecture covers Initialisation of 2-d array elements and an example program of matrix multiplication.

e.g.

float sales[ ][3]={

{100,200,900},

{900,100,876},

{100,200,900}

};

Matrix addition is a simple process of adding corresponding elements of two 2-d arrays and putting the result in a 3rd. array.
Note: Do write all the programs yourself. Then make changes here and there and re-execute. 

Double dimensional arrays Part - 2
05:30

String :

A string is in fact a char array last character of which is null terminator. A null terminator is a non-printable character having ASCII value 0. This is used to mark the end of a string. It is represented with \0.

There are many library functions to deal with strings. They are present in the header file string,h.

1) strlen() -> returns the length of a string. It does not count null terminator.(\0)

2) strcpy() -> copies one string into another. It takes two arguments. First is the target string and second is the source string.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Strings Part 1
10:28

More about strings functions :

1) strcat() -> is used to concatenate (join) 2 strings.

2) strrev() -> to reverse a string.

3) strupr() -> to convert a string into uppercase (capital letters).

4) strlwr() -> to convert a string into lowercase (small letters).

Listen carefully the distinction between strupr(),strlwr() and toupper() ,tolower() .

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Strings Part 2
07:26
+
Pointers
7 Lectures 39:36

Pointers :

They say that your knowledge about C is incomplete without knowing pointers. Hence I have elaborated them very painstakingly in the lectures.

A pointer variable is in fact a special variable that does not store ordinary value but memory addresse of other identifiers (variables, arrays etc.). 

You will be explained fully what exactly is a pointer variable. Diagrams have been used to bring home the point. The syntax of declaring pointer variables has been discussed in detail.

Small code snippets will make the things clear. Operators associated with pointers will be learnt viz. & (address of operator) , * (value at address operator) and **(pointer to pointer operator). 

Preview 07:27

Pointers in action : 

Here you will get a practical hand on pointers. An example will show you how to declare and store addresses into pointer variables. You will learn usage of  %u format specifier to print  the addresses. The usage of pointer to int , pointer to float , pointer to char will be explained.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Pointers in action Part - 1
05:48

Pointers in more action :

* is called 'Value at address' operator and comes in handy when we want to print the value of a variable using it's pointer.

e.g.

int *pt1, a=100 ;    // decl. of pointer to int

double *pt2, b=19000.00 ;    // decl. of pointer to double

pt1=&a ;   pt2=&b ;

printf("%.2lf\t%d", *pt2, *pt1) ;     // will print 19000.00 and 100 respectively 


Note: Do write all the programs yourself. Then make changes here and there and re-execute.


Pointers in action - Part 2
04:16

Pointer to pointer :

As a pointer variable is also a variable , hence it takes up space in the memory. Then of course it will have a memory address too. 

A pointer to pointer variable stores the memory address of yet another pointer variable.   

** operator comes in handy while declaring a pointer to pointer operator.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Pointer to pointer
05:47

Pointer Arithmetic :

Programmers have the liberty to use + and - arithmetic operators with a pointer variable. But these operators quite differently when applied on a pointer variable.

Let's assume that there is a variable var stored at address 8081.This address is stored in a pointer variable pt.

see the code snippet below -

int *pt ;  

int var=100 ;

pt=&var ;

++pt ; // will make the value of pt 8085 and NOT 8082.

The following statement would have made the value of pt as 8077.

--pt ; 

The reason behind this is when some value k  is added to a pointer variable then it adds as follows -

sizeof(datatype) * k

In the above example it was -

sizeof(int) * 1

As you know sizeof(int) would return 4. in this case multiplication with 1 is optional as we are adding only 1.

Now you can easily gauge what would happen when --pt is executed.

Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Pointer Arithmetic
06:13

Subtracting two pointer variables :

This lecture fully explains what happens when two pointer variables are subtracted.

Remember we can only subtract two pointer variables. No other arithmetic operator viz. + , / , * etc. is allowed. 


Note: Do write all the programs yourself. Then make changes here and there and re-execute.

Subtracting two pointer variables
02:49

An Array Name is pointer to base address:

When we declare an array, a pointer variable with the same name as the array name is automatically created in the memory. This pointer variable is assigned the base address of this array. Base address is the memory address of the very first element of array.

Hence an array name is actually a  pointer to base address.

  • Watch the full video for understanding the code.
  • Note: Do write all the programs yourself. Then make changes here and there and re-execute.
Arrays and Pointers
07:16
3 More Sections
About the Instructor
Anand Mahajan
4.5 Average rating
23 Reviews
1,784 Students
1 Course
Senior Programming Instructor

I started teaching programming when I myself was a student. I have been training Computer Science  students for the last 20+ years, I have a fair deal of experience in the training of C, C++, Core Java, Advanced Java, PHP and .Net to thousands of students. All these  students  vouch for my training skills , dedication to my responsibility towards my students.

What I believe is - my students who  repose faith in me deserve the BEST training. I have been the most recommended computer programming teacher in the region. But despite this enormous experience I always believe that there is always room for improvement. So I will appreciate if any student points out my weak points or foibles.