
Explore the essentials of the C programming language, from installing a compiler and writing a hello world program to mastering types, operators, conditionals, arrays, pointers, loops, and structures.
Install a GCC or goodnews C compiler on your system, choosing MinGW for Windows. On Mac, download and install the free access code suite of tools that provides C compilers.
Set up a text editor with syntax highlighting, create a C hello world program by including stdio.h, writing a main function, printing Hello world with printf, and compiling to run.
Explore C language primitive types, including integers, characters, and floating-point types, learn how to declare variables, and understand signed, unsigned, and the size and limits of each type.
Learn to use the man command to access C library documentation, explore section 3 for printf, and determine size of C types with sizeof and format specifiers.
Explore arithmetic operators in C, including addition, subtraction, multiplication, and division with integers A and B, and learn why integer division differs from floating point division.
Master shortcut assignment operators in C such as += and -=, and understand prefix and postfix increment and decrement, plus character arithmetic for converting between uppercase and lowercase using 32.
Discover decision making in C with the ternary operator, if-else, and switch. Learn how true and false are represented, relational and logical operators, and assignment versus comparison.
Explore boolean operators in C using integers to represent true and false, compare values with relational operators, print results, and distinguish equality from assignment.
Learn how to implement if, else if, and switch statements in C, handle command line arguments, and understand the basics of strings and pointers.
Learn how arrays store values of the same type, index from zero, compute totals and averages with loops, and print formatted results using floats for precise averages.
Examine arrays and strings in C through loops and indexing, including character arrays and null termination. Discover that a string is a null terminated array of characters.
Explore how pointers in the C language store memory addresses. Use the address of and indirection operators to read or assign values through pointer variables.
Demonstrate pointers in C by declaring int a and a int pointer, inspecting addresses and sizes, and using argc/argv as an array of strings to iterate program arguments.
Explore the three core C loops—while, do-while, and for—with formal definitions and examples that illustrate pre-check versus post-check behavior and the for-loop's initialization, condition, and increment.
Learn how to define and call functions in C, including void functions, value-returning functions, and parameter handling, with examples like a wedge printer and simple type casting.
Understand that parameters are passed by value by default, so changes inside a function don’t affect outside variables; use pointers for pass by reference, and arrays pass as pointers.
Explore how pass by value and pass by reference differ in C and C++, using swap examples to show why value swaps fail and pointer-based swaps succeed.
Explore the gcc function list to learn about formatted input with scanf, which reads from standard in and stores values via pointers, with header stdio.h.
Learn how to read two integers using scanf with prompts, then compute and print their sum, product, and maximum using simple functions and prototypes.
Explore pointer arithmetic in C, learn how adding to pointers advances by type size, and see how array indexing is syntactic sugar for pointer operations.
Find the max and min of an array using pointer arithmetic in C, and compare it to square bracket access while noting limits.h defines min and max values.
Learn how structures in C use the struct keyword, access members with dot or arrow, and use typedef and heap memory with malloc and free.
This demo defines a book structure with title and author, allocates an instance with malloc, and uses dot and arrow operators to access and print fields while stressing freeing memory.
Explore linked lists, including singly and doubly linked lists, using pointers to manage head and tail, add and delete nodes with malloc, and prevent memory leaks in stacks and queues.
Learn a stack implemented as a singly linked list in C, with node data as integers and operations push, pop, swap, clear, and print using malloc and free.
Interpret a list of command line arguments as stack operations, pushing integers or floats, swapping, printing, and using a memory slot mem for storage.
Implement and test a linked-list queue by enqueuing items to the end and dequeuing from the head to preserve order, as demonstrated with values 1, 2, and 3.
Enqueue all items from array as strings into a queue, then repeatedly prompt for completion and dequeue on yes until the queue is empty, demonstrating a queue based task list.
Explore the structure and operations of a doubly linked list, with nodes holding a name and phone number and managing head, tail, and current pointers while adding and deleting nodes.
Explore primitive data types in c++ by examining the size of each type with the size of operator, including char, wchar_t, short, int, long, bool, float, double, and long double.
Explore how namespaces create scope and enable overloaded functions in different namespaces, resolved with the scope resolution operator and using namespace std for cout and endl.
Explore c++ basic i/o with streams, using cout and cin for prompts and input, plus cerr and clog for errors and logs, illustrated by reading a name and greeting.
Showcases reading an entire line in C++ by using getline with cin, instead of the first-word input, with a 256-character limit and an example output of Hi John Doe.
Learn three initialization methods in C++—C style, constructor initialization, and uniform initialization—and apply them to the string class, exploring size, find, comparisons, concatenation, and swap.
Discover how string streams let you treat strings as streams with stringstream, enabling safer input with type checking and easier formatted output through stream operations.
Explore how c++ streams manage file input and output with ifstream and ofstream, copying text from a test file to an output file using getline and proper line endings.
Learn how to read numbers from a text file with an input file stream, accumulate them in a loop, convert to floats, compute average, print it, and close the file.
Learn how C++ functions differ from C in passing by value and by reference, using ampersand syntax, const references, and prototypes; explore void and return-valued functions and parameter behavior.
Explore how, in a lesson on without templates, C++ replaces multiple type-specific add functions with a single mechanism that handles integers, floats, and strings across different parameter and return types.
Master function templates in c++ to generalize operations across types with an alias T, enabling addition of integers, floats, booleans, and strings via implicit instantiation.
learn how explicit function template instantiation differs from implicit instantiation, using a multiply template with int, float, and bool to show when instantiations occur.
Explore c++ classes, including public, private, and protected members, constructors, and getters, and learn to create and manage objects with new, delete, scope resolution operator, and arrow operators.
Learn how destructors free heap-allocated objects by explicitly deleting dynamically allocated points in a line class to prevent memory leaks, since deleting a line does not cascade to its members.
This course is an introduction to the C and C++ programming language. The C programming language has spurred many language developments since its invention by Dennis Ritchie in the early 1970s. Many modern programming languages owe their syntax to C. C is still a very popular programming language after over 40 years. C++ is based on C, but extends the language with features such as function templates, namespaces, and (of course) classes.
In this course, we'll explore the C and C++ programming language. We'll start with data types of C, then quickly dispel the mystery (and fright) that surrounds C's most powerful element, the pointer. Understanding pointers first allows us to grasp the underlying nature of arrays and structs, parameters passed by reference, and many other things hidden by other languages but exposed in C.
Then we will move to streams in C++ , which simplify input and output a great deal.
Here's a brief list of what you'll learn:
C Topics :
C++ Topics :
If you've been thinking about learning C and C++, then this course is a good first step.