C Programming Language-Basic to Expert

Brand new Comprehensive course on C Programming that act as a complete reference guide.
3.5 (2 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.
160 students enrolled
$19
$30
37% off
Take This Course
  • Lectures 31
  • Length 6.5 hours
  • Skill Level Expert Level
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 2/2015 English

Course Description

What is the course about?

This brand new course provides a thorough introduction to the C programming language which is the core of the UNIX/Linux operating system and other embedded systems. This is designed with a need to understand the C programming language starting from scratch. This comprehensive course will give you enough understanding on C programming language from where you can take yourself to higher level of expertise.

1. The First few lectures will cover syntax and grammar, and expose students to practical programming techniques.

2. The remaining lectures will focus on more advanced concepts, such as dynamic memory allocation, pointers, arrays, etc.

Programming assignments and laboratory exercises are required to do by students. Please remember that this is a serious course on programming. I believe that programming language like C cannot be learned in few hours. It required continuous practice. Students may have to put a lot of efforts in order to become expert in programming and make the best use of this course.

What kind of material is included?

1. This course consists of high quality training content using quality videos with industry oriented hands-on examples.

2. I have tried to include the juice of my 10 years of Programming experience in this course.

3. The focus is on giving real life essential tricks and skills.

4. This course will have sets of online programming assignments and objective type quizzes.

5. The problems in each lesson are easy and difficult. I suggest students to take this course with pen and paper handy. Note the important points and take part in discussions. The exercise is the most important part in learning any language. I advise students to take the problems after each section.

How long will the course take to complete?

1. This is the comprehensive course covering almost all the topics of C programming.

2. The course is around 6 hours in duration. I advise students to cover not more than one lesson/section per day and do not move to the next lesson/section without doing the exercise.

How is the course structured?

1. Lectures, Classroom Discussions and C Programming Lab Exercises at the end of each chapter.

2. A perfect blend of theory and programming.

Why take this course?

1. Learning C programming language is basic to learn all other programming languages such as C++, Java, Python, etc. Because, all other advanced programming languages were derived from C language concepts only.

2. This is the comprehensive course covering almost all the topics of C programming.

3. This course will tends to replace text books on C programming ie it will be a complete reference of C programming.

4. You will learn how programming languages work with data, what program flow is, and how to use functions, methods and routines.

5. You will also get step-by-step instructions on how to create simple and advance C programs and how to run them.

6. For the college going students, this course helps in improving grades in college curriculum and increases the chances at the final Campus Interview.

What are the requirements?

  • A spare working computer with gcc compiler or visualization software like VMware Fusion or Virtual Box(if u don't have Linux OS)

What am I going to get from this course?

  • It is a long course of as many as 6 hours.
  • This course will lay down the foundation of programming.
  • Students will get a good hands-on with Linux Operating system as programming examples are explained on linux gcc compiler.
  • C is reasonably close to the machine. Students will learn various optimization techniques in order to become the expert programmer.
  • Students taking this course will be able to write serious program in C language.
  • Attempting algorithmic solutions to problems
  • Designing and coding moderate sized programs running to the order of a few hundred lines of code.
  • Reading, understanding and modifying code written by others
  • For the college going atudents, this course helps in improving grades in college curriculum and increases the chances at the final Campus Interview.
  • This C programming course skims through the basics of C and soon jumps over to core of C programming language which looks simple but difficult to master. This C Training will make the participant learn deep C secrets and develop a fairly advanced level of C programming expertise which is essential to write complex mission critical systems and application software.

What is the target audience?

  • IT professionals with little or no Linux experience
  • Software professionals
  • School Students who are beginning in programming language.
  • Computer and IT hobbyists
  • No prior programming experience is assumed

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Getting Started
09:09

C is a programming language developed at AT & T’s Bell Laboratories of USA in 1972. It was designed and written by a man named Dennis Ritchie. In the late seventies C began to replace the more familiar languages of that time like PL/I, ALGOL, etc. No one pushed C. It wasn’t made the ‘official’ Bell Labs language. Thus, without any advertisement C’s reputation spread and its pool of users grew. Ritchie seems to have been rather surprised that so many programmers preferred C to older languages like FORTRAN or PL/I, or the newer ones like Pascal and APL. But, that's what happened. Possibly why C seems so popular is because it is reliable, simple and easy to use. Moreover, in an industry where newer languages, tools and technologies emerge and vanish day in and day out, a language that has survived for more than 3 decades has to be really good. An opinion that is often heard today is – “C has been already superceded by languages like C++, C# and Java, so why bother to learn C today”. I seriously beg to differ with this opinion. There are several reasons for this.

14:40

Character Set

Constants, Variables and Keywords

Types of Constants

Rules for Constructing Integer Constants

Rules for Constructing Real Constants

Rules for Constructing Character Constants

Types of Variables

Rules for Constructing Variable Names

Keywords

Communicating with a computer involves speaking the language the computer understands, which immediately rules out English as the language of communication with computer. However, there is a close analogy between learning English language and learning C language. The classical method of learning English is to first learn the alphabets used in the language, then learn to combine these alphabets to form words, which in turn are combined to form sentences and sentences are combined to form paragraphs. Learning C is similar and easier. Instead of straight-away learning how to write programs, we must first know what alphabets, numbers and special symbols are used in C, then how using them constants, variables and keywords are constructed, and finally how are these combined to form an instruction. A group of instructions would be combined later on to form a program.

12:51

Armed with the knowledge about the types of variables, constants & keywords the next logical step is to combine them to form instructions. Once you have written the program you need to type it and instruct the machine to execute it. To type your C program you need another program called Editor. Once the program has been typed it needs to be converted to machine language (0s and 1s) before the machine can execute it. To carry out this conversion we need another program called Compiler. Compiler vendors provide an Integrated Development Environment (IDE) which consists of an Editor as well as the Compiler.

23:29

Type Declaration Instruction

Arithmetic Instruction

Integer and Float Conversions

Hierarchy of Operations

Associativity Of Operators

There are basically three types of instructions in C:

(a)Type declaration instruction − To declare the type of variables used in a C program.

(b)Arithmetic instruction − To perform arithmetic operations between constants and variables.

(c)Control instruction − To control the sequence of execution of various statements in a C program.

03:00

As the name suggests the ‘Control Instructions’ enable us to specify the order in which the various instructions in a program are to be executed by the computer. In other words the control instructions determine the ‘flow of control’ in a program. There are four types of control instructions in C. They are:

(a) Sequence Control Instruction

(b) Selection or Decision Control Instruction

(c) Repetition or Loop Control Instruction

(d) Case Control Instruction

The Sequence control instruction ensures that the instructions are executed in the same order in which they appear in the program. Decision and Case control instructions allow the computer to take a decision as to which instruction is to be executed next. The Loop control instruction helps computer to execute a group of statements repeatedly. In the following sections we are going to learn these instructions in detail. Try your hand at the Exercise presented on the following pages before proceeding to the next section, which discusses the decision control instruction.

Section 2: The Decision Control Structure
09:39

The Real Thing

Multiple Statements within if

A decision control instruction can be implemented in C using:

(a) The if statement

(b) The if-else statement

(c) The conditional operators

The keyword if tells the compiler that what follows is a decision control instruction. The condition following the keyword if is always enclosed within a pair of parentheses. If the condition, whatever it is, is true, then the statement is executed. If the condition is not true then the statement is not executed; instead the program skips past it. But how do we express the condition itself in C? And how do we evaluate its truth or falsity? As a general rule, we express a condition using C’s ‘relational’ operators. The relational operators allow us to compare two values to see whether they are equal to each other, unequal, or whether one is greater than the other. Here’s how they look and how they are evaluated in C.

15:04

Nested if-elses

Forms of if

The else if Clause

The ! Operator

Hierarchy of Operators Revisited

The if statement by itself will execute a single statement, or a group of statements, when the expression following if evaluates to true. It does nothing when the expression evaluates to false. Can we execute one group of statements if the expression evaluates to true and another group of statements if the expression evaluates to false? Of course! This is what is the purpose of the else statement.

C allows usage of three logical operators, namely, &&, || and !. These are to be read as ‘AND’ ‘OR’ and ‘NOT’ respectively. There are several things to note about these logical operators. Most obviously, two of them are composed of double symbols: || and &&. Don’t use the single symbol | and &. These single symbols also have a meaning. They are bitwise operators, which we would examine in Chapter 14. The first two operators, && and ||, allow two or more conditions to be combined in an if statement. Let us see how they are used in a program.

06:47

The conditional operators ? and : are sometimes called ternary operators since they take three arguments. In fact, they form a kind of foreshortened if-then-else. Their general form is, expression 1 ? expression 2 : expression 3 What this expression says is: “if expression 1 is true (that is, if its value is non-zero), then the value returned will be expression 2, otherwise the value returned will be expression 3”.

Section 3: The Loop Control Structure
11:09

Tips and Traps

More Operators

The versatility of the computer lies in its ability to perform a set of instructions repeatedly. This involves repeating some portion of the program either a specified number of times or until a particular condition is being satisfied. This repetitive operation is done through a loop control instruction.

There are three methods by way of which we can repeat a part of a program. They are:

(a) Using a for statement

(b) Using a while statement

(c) Using a do-while statement

10:33

Nesting of Loops

Multiple Initialisations in the for Loop

Perhaps one reason why few programmers use while is that they are too busy using the for, which is probably the most popular looping instruction. The for allows us to specify three things about a loop in a single line:

(a) Setting a loop counter to an initial value.

(b) Testing the loop counter to determine whether its value has reached the number of repetitions desired.

(c) Increasing the value of loop counter each time the program segment within the loop has been executed.

07:27

The continue Statement

We often come across situations where we want to jump out of a loop instantly, without waiting to get back to the conditional test. The keyword break allows us to do this. When break is encountered inside any loop, control automatically passes to the first statement after the loop. A break is usually associated with an if. In some programming situations we want to take the control to the beginning of the loop, bypassing the statements inside the loop, which have not yet been executed. The keyword continue allows us to do this. When continue is encountered inside any loop, control automatically passes to the beginning of the loop. A continue is usually associated with an if.

Section 4: The Case Control Structure
09:04

The Tips and Traps

C's most flexible program control statement is the switch statement, which lets your program execute different statements based on an expression that can have more than two values. Earlier control statements, such as if, were limited to evaluating an expression that could have only two values: true or false. To control program flow based on more than two values, you had to use multiple nested if statements. The switch statement makes such nesting unnecessary.

06:15

There are some things that you simply cannot do with a switch.

These are:

(a)A float expression cannot be tested using a switch

(b)Cases can never have variable expressions (for example it is wrong to say case a +3 : )

(c)Multiple cases cannot use same expressions.

Section 5: Functions
09:44

All functions have a type: they return a value of that type whenever they are used. The reason that C doesn't have `procedures', which in most other languages are simply functions without a value, is that in C it is permissible (in fact well-nigh mandatory) to discard the eventual value of most expressions.

10:41

Before the Standard, it was not possible to give any information about a function's arguments except in the definition of the function itself. The information was only used in the body of the function and was forgotten at the end. In those bad old days, it was quite possible to define a function that had three double arguments and only to pass it one int, when it was called. The program would compile normally, but simply not work properly. It was considered to be the programmer's job to check that the number and the type of arguments to a function matched correctly. As you would expect, this turned out to be a first-rate source of bugs and portability problems.

08:13

Function prototypes allow the same text to be used for both the declaration and definition of a function.

13:50

It is said, that the biggest and toughest problem can be solved by breaking it down into smaller problems and then solving it. One of the technique based on similar lines is recursion. Recursion in simpler and theoretical terms is solving a problem by solving smaller problems of “same” form and using their results to compute the final result. Recursion is a widely used and highly acceptable concept in algorithms and programs. In algorithms, recursions are talked about as methods which call themselves. However, the definition may sound absurd as methods calling itself would lead to infinite loop. Therefore, in a recursive method, the most important is the terminating condition where the recursive calls terminates. The terminating condition is a condition at which the sub-problem has become its smallest possible and hence needs to be handled differently.

31:33

The scope of a variable refers to the extent to which different parts of a program have access to the variable--in other words, where the variable is visible. When referring to C variables, the terms accessibility and visibility are used interchangeably. When speaking about scope, the term variable refers to all C data types: simple variables, arrays, structures, pointers, and so forth. It also refers to symbolic constants defined with the const keyword.

Scope also affects a variable's lifetime: how long the variable persists in memory, or when the variable's storage is allocated and deallocated. First, this chapter examines visibility.

Section 6: Arrays and Pointers
11:44

In C when we define a pointer variable we do so by preceding its name with an asterisk. In C we also give our pointer a type which, in this case, refers to the type of data stored at the address we will be storing in our pointer.

Pointer types and Arrays
11:44
12:07

The study of strings is useful to further tie in the relationship between pointers and arrays. It also makes it easy to illustrate how some of the standard C string functions can be implemented. Finally it illustrates how and when pointers can and should be passed to functions.

More on Strings and Arrays of Strings
12:49
08:35

Pointers, of course, can be "pointed at" any type of data object, including arrays. While that was evident when we discussed program 3.1, it is important to expand on how we do this when it comes to multi-dimensional arrays.

13:23

There are times when it is convenient to allocate memory at run time using malloc(), calloc(), or other allocation functions. Using this approach permits postponing the decision on the size of the memory block need to store an array, for example, until run time. Or it permits using a section of memory for the storage of an array of integers at one point in time, and then when that memory is no longer needed it can be freed up for other uses, such as the storage of an array of structures.

When memory is allocated, the allocating function (such as malloc(), calloc(), etc.) returns a pointer. The type of this pointer depends on whether you are using an older K&R compiler or the newer ANSI type compiler. With the older compiler the type of the returned pointer is char, with the ANSI compiler it is void.

11:38

C also permits the declaration of pointers to functions. Pointers to functions have a variety of uses and some of them will be discussed here.

Section 7: Enum, struct and Union
13:10

They are integers of some form. The compiler may chose to represent them using shorts, or as unsigned chars. Really, it isn't any of your business how your compiler represents them. The compiler chooses distinct values for each member of an enumeration.

11:12

It is rare for programs to work with simple data values, or even arrays of data values, that are individually meaningful. Normally, you get groups of data values that belong together.

11:31

Essentially, unions define a set of different interpretations that can be placed on the data content area of a struct.

Section 8: The C Preprocessor
12:56

The preprocessor language comprises a set of approximately 12-15 directives. Each is marked with the special character ‘#’. We note that these directives are not part of the specification of the C language.

10:49

There are several very handy directives that can be used to control how the program is assembled and compiled. That is, to stipulate which lines of source code are passed through to the output file (to be compiled) or ignored based upon a computed condition. These directives are particularly important if we want to build for different targets or when we are enabling or disabling debug code, for example.

26:15

In this chapter we will cover some advanced preprocessor topics. First we will talk in-depth about function-like macros, focusing on how to avoid some common pitfalls. We present the # and ## preprocessor operators and describe how they can be used when defining macros. An ancient trick-ofthe- trade called the "do { ... } while(0)" trick is presented. The article ends with a discussion on whether #if or #ifdef is preferable for conditional compilation.

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Saurabh Kumar Bansal, Linux Enthusiast,Software Programmer,Consultant

As an programming enthusiast, I want to share my knowledge and interests here.

My name is Saurabh Kumar.

I started learning about programming since high school, dived in "Basic" first, which eventually made me major in Electronics and Communications.

After completing the college, in 2005, I started working in the software and system departments at large corporations. Since then I have grown my Linux skills at various levels. Through the years I've worked in many positions as a Linux and system engineer, a programmer, a debugger and a consultant.

I have been working with C, C++ and Linux since 10 years. Its great to work with different Linux distributions and I find them really powerful. You see most of the supercomputers are based on Linux OS.

I find myself an accomplished software engineer specialising in object-oriented approaches. Extensive background in full life-cycle of software development process including requirements gathering, design, coding, testing, debugging and maintenance. My technical skills include:

C, C++

OS: Unix/Linux, Windows

Android Binder IPC

Few years ago, I forwarded myself for a position of training software engineers in a technical training center in my organization. It was there that I came to know about my passion towards teaching computer science subjects. Today I am one of the top technical trainers of my organization. Now, In addition to traditional classroom training and consulting, I am planning to start releasing video tutorial training for aspiring programmers, engineers or students.

I've been lucky enough to teach many people through my career. Some have gone on to become professional system engineers, some are software engineers or coders, and some are networking people. All have said that my teaching style is effective and approachable, so I've tried to capture that here.

I've plans of making some of the courses about programming, operating systems, kernel, device drivers etc. I give all my heart into creation of courses. I always try to explain everything the easiest possible way. I'm sure that my courses will help you in the adventure.

I offer a range of high quality training content using quality videos backed-up with industry oriented hands-on examples. My main emphasis is to teach technology the way it is used in professional world. The focus is on giving real life skills that are essential in today's environment. My courses on Technology includes everything ranging from Programming, Operating Systems, linux kernel, linux device drivers to Android Binder and JavaScript.

It is so great be here and share knowledge with you.

Have fun and learn enough!

Ready to start learning?
Take This Course