
Explore the fundamentals of C programming, a high-performance, hardware-close language essential for embedded systems, firmware, drivers, operating systems, and databases, with real-world guidance to avoid expensive mistakes.
Master practical C programming fundamentals through real-world industry practices, learn best practices, avoid deadly mistakes, and build problem-solving and software engineering skills using Ubuntu 18.04, Eclipse, and make.
Learn to set up Ubuntu 18.04 in a virtual VM using VMware Workstation Player, download the 64-bit ISO, allocate 2 GB RAM and 20 GB disk, and configure bridged networking.
Set up Eclipse IDE for C/C++ by downloading the C/C++ developer package, extracting the zip, and launching the editor to write code while compiling on Linux via the command line.
Understand how a C program becomes an executable: source code passes through preprocessor (expand macros, remove comments), then compiler to assembly, then linker with libraries, orchestrated by a Makefile.
Let's get started in writing some C codes! Download the myprogram.zip in the resource and import to your Eclipse IDE before you continue to the next chapter
Examine how a C program uses source files to implement functions and header files to declare prototypes, including a special function called me, with Makefile topics deferred.
Discover how to use C comments to annotate code, including block comments /* ... */ and line comments //, so the compiler ignores them, with optional author and copyright metadata.
Use a semicolon at the end of each line in your source or header files to signal the compiler that you finished a statement, preventing parsing errors.
Learn how to use the include directive in C to bring in standard libraries with angle brackets and your own headers with double quotes, using stdio.h for printf and scanf.
Learn how the preprocessor runs before compilation, removing comments and resolving include paths. See how macros defined with the defined keyword are replaced with values or text before the compiler.
Explore how a Makefile organizes a C project by defining stages, dependencies, and rules, using variables, compilation with flags (-g, -O0, -W), object files, linking, and a clean target.
Learn how to declare and implement C functions, understand inputs, outputs, and return values, and see a simple example that adds one to a number and prints the result.
Use printf and scanf in c to prompt users, read integers, and store them via the address-of operator. Also learn debugging macros that reveal file, function, and line.
This lecture refers to the following lectures:
Array Basics
Types of Loops
Arithmetic Operators
Explore how if statements drive conditional execution in C, including if-else blocks, single-line forms, and the use of operators, not, and/or for range checks, plus pointer and memory allocation checks.
Explore the main loop constructs in C, including while, for, and do-while, and learn how break and conditions govern entry and exit in iterations.
Explains infinite loops across while, for, and do-while, showing how a loop can run forever, and how adding a delay with sleep prevents 100 percent CPU usage.
Learn how break and continue control loop execution in C, using examples with for and infinite loops to break out or skip iterations.
Explore how to use the switch statement in Linux C programming, including case, default, and break to control flow, with fall-through behavior explained.
Explore how the goto keyword enables unconditional jumps to error labels in C, balancing clearer control flow and code coverage through an error-checking example that validates name, age, and occupation.
Learn how binary digits form bits and bytes, why eight bits equal a byte, and how decimal versus binary scales (1024 vs 1000) affect storage and throughput.
Explore common data types in the C programming language, including signed and unsigned integers, char, and floating types, and learn how the size of operator reveals memory in ASCII terms.
Explore the lifetime and scope of variables, noting local variables are invalid, memory is recycled after a function ends. Compare passing by value or by reference and global variables.
Explore the C struct data type by defining a user structure with fields id, name, age, and occupation, then initialize with memset and access members via the dot operator.
Explore type casting in C by converting between int, short, long, and signed char, and learn how memory size and two's complement influence value interpretation when casting.
Learn how the static storage class in C makes local variables persist across function calls, initialized once, and limits global scope to a single file.
Discover how the static keyword limits function scope to a single source file. Distinguish local helper functions from public ones using prototypes and headers to control visibility.
Explore how the extern storage class extends a global variable or function across files, using extern declarations for access without initialization and for prototypes.
Explore the const storage class in C, making variables read-only to prevent modification. Learn how to pass const arguments safely and allocate writable memory to avoid crashes.
Learn to declare global constants in C using the const keyword, the cast keyword, or the hash define macro, and note that macros are preprocessor replacements that don't occupy memory.
Learn how typedef renames data types in C, creating concise aliases for primitive types and structures, and how this convention emphasizes type sizes for cleaner cross-file code.
This module concludes part 1 of the lecture. You can download the source codes that we have been working on together in the resource
Explore how pointers store memory addresses, reference and dereference values, declare with a type and asterisk, use ampersand for addresses, and understand dynamic memory allocation risks and memory violations.
Explore memory in C through stack, heap, and read-only segments, and how pointers, manual allocation and deallocation, and memory leaks affect program safety.
Please download myprogram-part2.zip in the resource, which is an empty project that we will be building together for the rest of the lecture.
Learn to manage memory in C by contrasting static and dynamic allocation, using malloc for heap memory, and freeing with free while nulling the pointer to prevent dangling references.
Learn to use pointers as input and output arguments in C, returning status codes while updating days and month name via out parameters and validating inputs.
Learn how a function returns a pointer, why local variables crash, and how static or heap memory can safely hold and free memory when done.
Explore void pointers, which have no type and can point to any data, requiring casting before dereferencing and enabling generic use with structures and typedefs.
Learn how arrays in C store fixed-size, same-type data contiguously, declare and initialize them, access elements via zero-based indexing, and handle arrays of structures with size and for loop examples.
Use three pointers and malloc to allocate eight bytes for a char array, initialize with memset, and access elements with square brackets while printing.
Encode data with pointer arithmetic in a C buffer using memcpy. Understand memory allocation, pointer movement, and safe freeing to simulate network transmission.
Define a function pointer to a function’s signature and invoke it directly or via a callback to handle errors; use it to pass custom error handling to a library function.
Learn how C streams are character arrays or pointers, declare strings with a terminating null character, and distinguish single quotes from double quotes for chars and streams.
Compare how sizeof and strlen behave in C to measure memory and string length; learn when to use each, and why pointers and terminators affect results.
Explore copying data in C with memcpy for general memory and strcpy for streams, emphasizing safe use with buffers, sizes, and structure copies to avoid overflows.
Explore when to use memcmp versus strcmp for data comparison in C, including strings, streams, and pointers, and learn how size and dereferencing affect results.
Learn to format data with sprintf and snprintf to build dynamic strings, such as a url from an ip address, while avoiding buffer overflows.
Explore declaring and using an array of strings in C, including a two-dimensional char array and a read-only pointer array. Learn to initialize, index, modify, and understand memory implications.
Learn how to concatenate strings in C with strcat and strncat, appending to the end of buffers for a pipe-delimited employee list built with a dynamic loop.
Use the strstr function to locate a substring in a stream, returning a valid pointer or null, and apply it to verify names and identify IP address formats.
Learn how to break a stream into tokens using strtok by a pipe delimiter, allocate memory for each token, store them in an array, and free memory to avoid leaks.
Learn how to escape special characters in C, such as the percent sign and double quotes, using backslashes and doubled percent signs in printf to print text correctly.
Explore how operators in a C program manipulate operands and evaluate expressions, including arithmetic, assignment, increment and decrement, relational, and logical and bitwise operators.
Master arithmetic operators in C by exploring addition, subtraction, multiplication, division, modulus, and pointer arithmetic, emphasizing precedence, brackets, and type casting.
Explore assignment and compound operators in C, learning how A = B and A += B perform arithmetic before assignment, and see examples like modulus and division to update variables.
Learn how the increment and decrement operators (++) and (--) affect a variable in C, including before and after placement, and the evaluation order that updates values during expressions.
Explore relational operators in C, learn how to compare values for true or false in if statements, distinguish equality == from assignment =, and use !=, >, < with examples.
Explore how the C logical operators and, or, not, xor combine relational expressions to yield a single boolean result, and apply them in if statements with brackets for precedence.
Learn how bitwise operators manipulate numbers at the binary level, including left and right shifts, and, or, not. Understand binary representation and least and most significant bits shape these operations.
Master bitwise operators in Linux C programming with practical left shift, and, or, and not operations to check, set, and clear bits using binary representations.
Learn how conditional operators replace if-else blocks by evaluating a relation expression and selecting between two results with ? :, illustrated by a house price example.
This is the end of the course. You can download myprogram-part2_withcode.zip, which contains all the C codes that we have worked on together.
The C language has been around for a long time… and it is commonly considered as a low level programming language because it tends to bring your application closer to the computer hardware, requiring you to manage system resources manually and carefully.
No other programming languages have such granularity, which makes C a unique and desired programming language for embedded device, firmware, drivers and infrastructure software such as a database.
Instead of learning C from text book or from a traditional university teacher, I believe the best way to learn C programming language or any other languages is to learn from someone who has been in the industry, made expensive mistakes and finally done something that made an impact.
In the past 10 years, I have built many innovative solutions and applications in the smart metering, communication, database and security industries and at the same time made expensive mistakes in order to become better.
For this reason, I will show you the fundamentals of C programming based on my real industrial experience. In addition to just show you how certain things work, I will also show you what to do and what no to do in order to avoid deadly and expensive mistakes in your career.
In most of the lectures, I will guide you through the C codes that we will be building together step by step with combination of some power point presentations.
If you are a beginner or someone who knows a little about C programming and would like to further enhance your skillsets. This course will help you jump start your career with C programming.
Enroll today and see you inside!
Cary