From 0 to 1: C Programming - Drill Deep

C Programming is still a very useful skill to have - and this is the course to pick it up!
4.5 (79 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,462 students enrolled
$19
$50
62% off
Take This Course
  • Lectures 60
  • Length 12.5 hours
  • Skill Level All Levels
  • 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 1/2016 English

Course Description

C Programming is still a very valuable skill - and its also surprisingly easy to pick up. Don't be intimidated by C's reputation as scary - we think this course makes it easy as pie!

What's Covered:

  • Conditional Constructs: If/else and case statements have a surprising number of little details to be aware of. Conditions, and working with relational and logical operators. Short-circuiting and the order of evaluation
  • Loops: For loops, while and do-while loops, break and continue. Again, lots of little details to get right.
  • Data Types and Bit Manipulation Operations, again full of little gotchas that interviewers and professors love to test.
  • Pointers: Memory layout of pointers and variables, pointer arithmetic, arrays, pointers to pointers, pointers to structures, argument passing to functions, pointer reassignment and modification - complete with visuals to help you conceptualize how things work.
  • Strings: Strings, Character pointers, character arrays, null termination of strings, string.h function implementations with detailed explanations.
  • Structs and Unions: These seem almost archaic in an Object-Oriented world, but worth knowing, especially in order to nail linked list problems.
  • Linked lists: Visualization, traversal, creating or deleting nodes, sorted merge, reversing a linked list and many many problems and solutions, doubly linked lists.
  • IO: Both console and file IO
  • Enums, typedefs, macros

Talk to us!

  • Mail us about anything - anything! - and we will always reply :-)

What are the requirements?

  • The course assumes that the student has a way to write and run C programs. This could include gcc on Mac or Unix, or Visual Studio on Windows.

What am I going to get from this course?

  • Write solid, correct and complete C programs
  • Advance - quickly and painlessly - to C++, which is a natural successor to C and still widely used
  • Ace tests or exams on the C programming language
  • Shed their fears about the gotchas and complexities of the C programming language
  • Make use of C in those situations where it is still the best tool available

What is the target audience?

  • Yep! Computer science or engineering majors who need to learn C for their course requirements
  • Yep! Embedded systems or hardware folks looking to make the most of C, which is still an awesome technology in those domains
  • Yep! Any software engineer who will be giving interviews, and fears interview questions on the tricky syntax of C

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 your feet wet
02:04

The C programming language is still relevant, especially for three kinds of folks. One, embedded systems or hardware folks moving to software. Two, folks looking to learn C++, and needing first an introduction to the details of C. Three, folks who have are taking a C course in college, and have no choice but to learn the language:-)

12:29

Let's start with a very high-level view of what a C program looks like. The compiler, preprocessor, main function as the entry point, and headers. All of these are little bits you've got to understand before you can write your first C program. But fear not! Nothing too complicated here!

15:49

A quick introduction to the important data types in C - and to two important ideas: that of overflow (what happens if the data in a short int exceeds 32,767?) and that of characters as numeric types in disguise (you can add chars like you would ints)

Section 2: Language constructs
16:20

If/Else statements are decision control structures - they transfer control to different points in code depending on a condition. Let's understand their syntax and intricacies.

16:07

The condition is at the heart of an if/else statement, and there is a lot going on here: relational operators, logical operators, the order of evaluation, and short-circuiting.

If/Else Statements - III
09:00
07:13

We wrap our section on if/else statements by dwelling a bit on the else portion of the if/else loop.

18:07
A bunch of code examples - including many little gotchas that professors and interviewers love testing :-)
If/Else Conditions
5 questions
17:52

The switch-case-default control structure, aka the case statement, is a strange bird. Its bristling with strange rules, which is perhaps why its not used very often.

11:01

We continue talking about the eccentricities of the switch statement - and you can bet there are a lot of them!

03:51

We wrap up with the case structure - it is bristling with strange rules, which is perhaps why its not used very often.

Case Statements
4 questions
15:45

Once you're used to the idea of an if/else statement, a while loop is not much of a stretch. We parse its structure in detail.

08:33

We keep going on while-loops - conditions and gotchas, and the break and continue statements make their first appearance.

18:11

For loops are incredible - they are probably the most important and popular construct in all programming languages. Let's see how they work.

15:14

The ++ and -- operators were introduced by C, and have become ubiquitous in programming. They can be confusing, so let's make sure we understand them - and also that we understand unary/binary/ternary operators, and their precedence rules.

Loops
5 questions
Section 3: Functions
09:49

Functions are an incredibly powerful idea - let's understand why (hint: Dilbert has the answer). Also - return value and argument list - terms that will become part of our everyday lexicon if we do enough programming.

18:49

Declaring, defining and calling a function: understand exactly what these terms mean.

06:50

Pass-by-value and pass-by-reference: Understand exactly what these terms mean.

Section 4: Some loose ends
13:04

The characteristics of a variable - where it resides, what default value it has (prior to initialisation), its visibility and the lifetime of its existence - are governed by something called the Storage class of a variable. Let's understand the 4 storage classes: automatic, register, static and external.

14:34

We start with a quick tour of how code compilation works - what the steps are to go from source code to an executable file. Once we understand that, we can easily make sense of the preprocessor, and of the common preprocessor directives such as #define and #include

08:58

Making sure we understand the 4 major types of pre-processor directives: macros, file inclusions, conditional compilation directives, and miscellany. Macros and functions each have their place in C

Section 5: Console IO
13:07

Console IO - reading from or writing to screen - is one of the bits about C programming that folks really find complicated - but don't fear! We'll break it into byte-sized chunks. Starting with printf.

10:34

We keep going with printf - there's a lot where this came from :-)

08:03

We dig deep into scanf, which reads input from screen.

10:06

We wrap up this section on Console IO by discussing the miscellaneous IO functions: sprintf, fprintf and sscanf.

Console IO
4 questions
Section 6: File IO
05:33

File IO in C - and indeed File IO in pretty much all languages - is based on 2 key concepts: buffers and streams. A buffer is a temporary storage area (in memory) for data that's in a file (on disk). A stream is data-in-motion - a conveyor belt moving data from one place (buffer or device) to another. Once you understand this, all File IO will make a lot more sense.

09:33

The things that you do with files - open them, close them, read them, write to them - are hardly rocket science. And once you recall what streams and buffers are, its even less arcane. Just look past the syntax (which is pretty arcane)

08:53

Now that we are done with really understanding how fopen works, the other operations will stream by (bad joke alert!)

03:06

If you can open a file in a text editor and make sense of what it says - then its a text file. Else its a binary file. Just remember that, and you'll be just fine:-)

File IO
4 questions
Section 7: Bit Manipulation
10:07

We dig into the bitwise AND, OR and NOT operations - visually inspecting how they work.

08:39

We continue with bit manipulation - the right shift and left shift operators are very powerful, but they have 2 issues that you should be sure to understand: overflow, and fill.

13:13

Before diving headlong into bit manipulation problems it's helpful to learn a few useful tricks which help you build a strong foundation to visualize working with bits.

13:30

Functions to get the nth bit of an integer and to set the nth bit of an integer. These are the building block functions and the concepts underlying these will be used for harder bit manipulation problems.

18:54

Print all the bits used to represent an integer from the most significant bit to the least significant. Learn some subtle details about the shift right (>>) with negative numbers!


Count the number of 1s in an integer, and learn a neat trick which allows you to do it in complexity O(number of 1s).

10:10

Reverse the bits in an integer. This pulls together a whole bunch of stuff from the last few problems. As in the case of hard problems, visualizing the process is key to solving this!

Section 8: Structs and Unions
11:14

C Structs are the first user-defined types that we will encounter - the precursor to objects/classes and all of Object Oriented Programming

C Structs: Everything you can do with them
Preview
10:24
04:12

A space-saving trick - C unions have largely passed into history. Just remember that they are just like structs, but for one key difference.

Section 9: Dynamic Memory Allocation
16:21

We will introduce the idea of dynamically allocating memory, i.e. creating space in memory for data on-the-fly. This contrasts with the typical way in which memory is allocated in C programs.

06:06

If memory is allocated dynamically, it is super-super important that you also free that memory. Else, your program will leak memory. For any programmer of a certain age, the term 'memory leak' is enough to induce nightmares. So be absolutely sure to free dnyamically allocated memory.

14:36

There is a fundamental difference between dynamically and statically allocated memory: dynamically allocated memory lives on the heap, while regular statically allocated memory lives on the stack. Don't worry if that did not make a lot of sense - it will after you watch the lecture:-)

06:50

The C programming language has some other handy ways of allocating memory - let's make sure to understand these.

Section 10: Arrays
17:11

Understand what an array in C is: its a contiguous block of memory that holds individual elements, each of the same size and layout.

08:40

Its a bit of a black art to pass arrays to functions as arguments - but don't be intimidated! Its easy once you think about it right.

03:33

We described arrays as contiguous blocks of memory, holding individual elements that are each of the same size and layout. Well, that's exactly what a string is - an array of characters:-)

Section 11: Pointers
19:59
Pointers are the foundation of all hard interview problems, visualizing memory layout using pointers helps us understand what's really happening under the covers.
13:35

Practice is the key to understanding key pointer concepts, solve pointer problems by visualizing the memory layout.

Arrays are pointers at heart, work with them exactly like you would with pointers.

11:33

Function pointers have really annoying - wonky! - syntax, but if you use typedef, and remember how to declare and use them, they are a quite handy.

11:43

Pointers know how much space the data they point to occupies. Which means you can access all elements of an array with a single pointer, pointer arithmetic is pretty cool!

07:37

A whole bunch of practice with pointer problems. These should be easy because you will have the memory layout right there to help you visualize things.

Section 12: Strings are just pointers at heart
14:07

Strings are character pointers which are equivalent to character arrays. Solve functions from the string.h library for practice dealing with pointers.

09:39

Pointers as arguments to functions have subtleties which need to be understood to use them correctly. Understand reassignment and modifications of pointers in a function and see how the original pointers are affected in the calling code.

19:23
Let's solve some harder problems from the string.h library, remember the little details like string termination, null inputs all matter in an interview!
Section 13: Linked lists can be fun!
10:28

Pointers just hold addresses of a memory location, which means we can have pointers to pointers to pointers. Sounds complicated? No worries, there are examples to help you understand these every step of the way.

11:12

Pointers to pointers requires a heightened conceptualization of memory layout. See detailed visuals on how pointer modification and reassignment work. User defined types or structs can also have pointers to them, memory layout and visualization of struct pointers.

17:16

Linked lists are favorite interview questions for software engineering roles. If you can work linked lists you're on your way to tackling more complicated problems. Understand the memory set up of linked lists and start with a few problems to gain confidence.

Get the length of a linked list, access the nth element in a list, and append an element to the end of the list - all this while handling null lists and other details.

16:19

For a simple concept, linked lists can get surprisingly tricky very quickly. Practice and practice again to gain mastery over linked list problems.

Use the linked list as a stack and implement pop, delete all the elements in a list - tricky memory freeing here, insert an element at a specified position and in a sorted list - these are similar but the edge cases differ

18:59

Once you've actually solved all the examples we've got so far, you'll find that linked lists are fun! This class has a particularly difficult sample problem which will introduce you to the fast and slow pointers which traverse a linked list at different speeds. Useful for a lot of tricky maneuvering.

Append one list to another and split a list into two by using fast and slow pointers. This second problem is much, much harder than it seems.

17:31

By now you should be able to solve linked list problems in your sleep. Let's practice a few last ones to gain complete master over them.

Remove duplicates from a sorted list, move the first node from one list to another, merge two sorted lists and finally reverse a linked list.

21:03

Doubly linked lists lend themselves to fewer interesting problems. However its important to not overlook them, let's try deleting a node in a doubly linked list and see how to work with forward and reverse pointers.

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Loony Corn, A 4-person team;ex-Google; Stanford, IIM Ahmedabad, IIT

Loonycorn is us, Janani Ravi, Vitthal Srinivasan, Swetha Kolalapudi and Navdeep Singh. Between the four of us, we have studied at Stanford, IIM Ahmedabad, the IITs and have spent years (decades, actually) working in tech, in the Bay Area, New York, Singapore and Bangalore.

Janani: 7 years at Google (New York, Singapore); Studied at Stanford; also worked at Flipkart and Microsoft

Vitthal: Also Google (Singapore) and studied at Stanford; Flipkart, Credit Suisse and INSEAD too

Swetha: Early Flipkart employee, IIM Ahmedabad and IIT Madras alum

Navdeep: longtime Flipkart employee too, and IIT Guwahati alum

We think we might have hit upon a neat way of teaching complicated tech courses in a funny, practical, engaging way, which is why we are so excited to be here on Udemy!

We hope you will try our offerings, and think you'll like them :-)

Ready to start learning?
Take This Course