Programming Tutorials - C, C++, OpenGL, STL
Want to learn C++? C++ Made Easy, Lesson 1 (all lessons)
Want to learn C? C Made Easy, Lesson 1 (all lessons)
Looking for advanced topics? Check out the full tutorial list
A C++ tutorial and a C tutorial, OpenGL with C++ tutorials, C++ Standard Template Library (STL) tutorials, articles on both the C and C++ programming languages and computer science, as well as Denthor of Asphyxia's graphics tutorials converted to C++ (mainly C code). Please email me with corrections or submissions to this page.
subscribe to updates via RSS.
Programming Tutorials Map
* Beginner tutorials
o C++ Made Easy
o C Made Easy
* Advanced Language Features and Concepts
o Tutorials on advanced C and C++ features
o C++ Standard Template Library (STL) tutorial
o Understanding Floating Point Numbers
o Remote Procedure Calls
o Using Microsoft ADO with SQL Databases in C++
* Graphics Programming
o SDL Tutorial
o OpenGL Tutorial
o 3D Rotations Tutorial
o C/C++ DOS Graphics Tutorial
* Artificial Intelligence, Algorithms and Data Structures
o AI Tutorials
o Basic Data structures (queues, stacks, trees, heaps)
o Big-O notation, Sorting and Searching
o Advanced Algorithms: compression, encryption, graph algorithms, and dynamic programming
o The limits of computation
* Other topics
o Coding Style
o Compliation and Makefiles
o Memory Management
o Debugging
o Other Programming Languages
o Miscellaneous Articles
C++ Made Easy: Learning to Program in C++
* Intro to C++ The basics of C++ (Quiz)
* If statements If statements, and some boolean information (Quiz)
* Loops in C++ All you want to know about loops (Quiz)
* Functions Functions...all about them, making and using the critters (Quiz)
* Switch case About the switch case structure (Quiz)
* Pointers Using pointers to access memory locations (Quiz)
* Structures Structures, all about 'em, and how to use 'em (Quiz)
* Arrays All about arrays (Quiz)
* Strings About character arrays (strings) (Quiz)
* File I/O About file i/o (Quiz)
* Typecasting Typecasting: making variables look like another data-type (Quiz)
* Classes Introduction to Object Oriented Programming (OOP) (Quiz)
* Inline functions More information about functions (Quiz)
* Command line arguments How to accept command line arguments (AND checking file existence) (Quiz)
* Linked Lists The basics of singly linked lists
* Recursion Recursion--a function calling itself
* Variable argument lists Functions accepting a variable number of arguments
* Binary Trees Introduction to an important abstract data type
* Inheritance Inheritance - An Overview
* Inheritance continued Inheritance - Syntax and examples
* Initialization Lists and Inheritance Initialization lists are necessary for most classes that use inheritance or include objects
* C++ Class Design More tips and tricks for class design
* Enumerated types Learn to use enumerated types for type-safety and clarity
* Formatted Output in C++ using iomanip Learn how to create nicely formatted output in C++
* Generating random Numbers Tutorial by RoD on generating random numbers.
* Using Modulus Tutorial by RoD on the modulus operator
* Templates in C++ Learn how to use templated classes in C++
* Templated functions Templates can be used to write generic functions as well as generic classes
* Template specialization and partial specialization Learn how to optimize templates by creating specialized instances for certain types
* Understanding the C Preprocessor -- Constants, Macros, and other Tricks Learn how to use the C preprocessor
[Top]
C Tutorial - C Made Easy
This tutorial is based on the above tutorial, but uses only standard C language features.
* Intro to C The basics of C (Quiz)
* If statements If statements, and how to use boolean operators (Quiz)
* Loops in C All you want to know about loops (Quiz)
* Functions Functions...all about them, making and using the critters (Quiz)
* Switch case About the switch case structure (Quiz)
* Pointers Using pointers to access memory locations (Quiz)
* Structures Learn about grouping multiple variables together under a single name (Quiz)
* Arrays Learn about arrays--one variable with many values (Quiz)
* C-style Strings About character arrays (strings) (Quiz)
* File I/O About file I/O in C
* Typecasting Typecasting: making variables look like another data-type (Quiz)
* Command line arguments How to accept command line arguments (Quiz)
* Linked Lists The basics of singly linked lists
* Recursion Recursion--a function calling itself
* Variable argument lists Learn to write flexible functions accepting a variable number of arguments
* Binary Trees Learn about binary trees, a fundamentally important data structure!
* Removing the Mystery of Function Pointers Function pointers are a powerful tool for C and C++ programmers
* References C++ references let you write cleaner, more efficient code
* Const Correctness--Why bother? Find out what const-correctness and, more importantly, why it should matter to you
* How and When to Use Private Inheritance Understand what private inheritance means and how to use it
* Bitwise Operators in C and C++ Learn how to use bitwise operators
* When To Use Goto: A Partial Defense of the goto Statement Goto can actually be used quite profitably as a means for handling errors cleanly!
* Using Exceptions for Error Handling in C++ What are exceptions, why do we use them, and how can we best take advantage of them?
* Using Namespaces in C++ Namespaces are a useful way of maintaining logical divisions in your code and encapsulating functionality
* Getting out the static Keyword A multipurpose keywords, static can be used globally, locally, and on class variables, with different meanings in each context
* File I/O in C Strict C file I/O and binary file I/O
* Templated Classes in C++ Templates in C++
* Using auto_ptr to manage memory Learn how to use auto_ptr to help avoid memory leaks
* C++ style strings C++ strings can save you a lot of time and frustration when used correctly
* The friend keyword and data encapsulation Learn how to use the friend keyword to simplify class interaction while preserving data encapsulation
* Secure Coding Learn how to make your programs safe against buffer overflow and double free attacks
* Unicode: What you Can Do About it Today Do you have an international audience? Do you need to support multiple multiple languages? Learn to write programs that support Unicode!
* Multiple Inheritance Learn how to use multiple inheritance to structure your C++ code
* Solving the Diamond Problem with Virtual Inheritance Learn how to use virtual inheritance to solve the complications introduced with multiple inheritance.
* Operator overloading How and why to use (and not to use!) operator overloading for more readable code
* Constructors and Destructors Learn about some of the subtleties of C++ constructors and destructors
[Top]
C++ Standard Template Library (STL)
* An Introduction to the Standard Template Library (STL) An introduction to and explanation of the Standard Template Library and its features
* The STL Vector Container A tutorial on using the vector class
* STL Iterators A tutorial covering iterators, an important component of the Standard Template Library for accessing elements of collections
* STL Map Container Learn how to use associative arrays in the C++ Standard Template Library to store (key, value) pairs
* STL List Container Learn how to use linked lists in the C++ Standard Template Library to store data
[Top]
Understanding Floating Point Numbers by Jeff Bezanson
Every programmer should understand enough about floating point numbers to avoid the pitfalls of assuming perfect precision.
* Background: Accuracy vs. Precision
* Floating Point Representation
* Bonus: Printing Floating Point Numbers Cleanly
[Top]
Using Remote Procedure Calls (RPCs) by Jeff Bezanson
* Background and Using the RPC compiler
* Writing the Server Code
* Writing the Client and Putting it All Together
* Get the code
[Top]
Using Microsoft ADO with SQL Databases in C++ by Patrick Mancier
* Tutorial index page
* Part 1: Introduction to SQL
* Part 2: Introduction to ADO
* Part 3: ADO Wrapper Classes
* Part 4: Creating the ADO Manager Class
* Part 5: Using the CADOManager in Practice
SDL Tutorials
(By Thomas Carriero)
* Setting up SDL
[Top]
OpenGL Tutorials
(By RoD)
* Intro to OpenGL
* OpenGL vs DirectX Comparison of OpenGL and DirectX
* OpenGL and Windows Intro to Windows Programming for OpenGL
* The WinMain procedure More Windows Programming background
* Windows Programming The guts of Windows Applications
* Intro to WGL Intro to Windows Graphics Layer
* Getting started with OpenGL The first OpenGL program
* Projections Using Projects in OpenGL
[Top]
Rotations in Three Dimensions by Confuted and Silvercord
This is a series of tutorials detailing the math required for performing three dimensional rotations.
* The Basics of 3D rotations
* Rotation Matrices
* Rotation about an Arbitrary Axis
* Uses for what you've learned
* Using Quaternions
[Top]
Graphics Programming Tutorials
I offer these tutorials more as a relic of programming lore than a serious study in how to program graphics today; nonetheless, if you are searching for C/C++ DOS graphics, these tutorials may be helpful. They are written by Grant Smith, aka Denthor of Asphyxia. You can find the source code mentioned in the tutorials here.
* The MCGA mode and how you get into it in C++ without a BGI
* What is the Pallette?
* Circle and line algorithms
* What is a Virtual Screen and why do we need it?
* What is scrolling?
* Why do I need a lookup table? What is it?
* The Principals of Animation
* Optimisation
* 3D System
[Top]
AI Tutorials
* Perceptrons Learn about a simple way to simulate neurons
* MiniMax Game Trees Learn about coding a decision-making program
* Chess Board Representation Learn about efficient chess board representations
* Solving problems with genetic algorithms An overview of how genetic algorithms work, and how they've been used.
[Top]
Data Structures
* Stacks Learn what a stack is and when it might be used
* The Queue Read about what a queue is and how to implement it
* Heaps Learn what a heap is, why, when and how to use heaps
* Graphs in computer science Learn the difference between directed and undirected graphs and why they're useful
* Two-three trees Learn about a data structured that helps with balancing the search tree
[Top]
Algorithmic Efficiency and Sorting and Searching Algorithms
* Algorithmic Efficiency and Big-O notation How to determine the efficiency of your program and understand common algorithms
* Efficiency, Time and Space Learn how time and space are balanced in the design of algorithms
* Search Algorithms Covers various techniques for search algorithms, from linear search to advanced versions of binary search
* Comparison of Sorting Algorithms See how the various sorting algorithms compare (and how to compare them) and pick which ones to use
* Intro to sorting algorithms: bubble sort Learn about sorting algorithms, bubble sort, and how it compares to other sorting methods
* Selection sort and Insertion sort Two sorting algorithms usually superior to bubble sort
* Heap Sort A sorting algorithm based on heaps that runs in O(nlog(n)) time.
* Merge Sort A stable sort running in O(nlog(n)) time, generally faster than heap sort, but requiring scratch space.
* Quicksort [By Jakub Bomba (axon)] Quicksort is the fastest sort in the average case, requires no additional space, and is stable
* Radix Sort Learn about radix sort, a special case sorting algorithm for certain inputs
[Top]
Advanced Algorithms
* Exclusive-OR (XOR) Encryption A tutorial on Exclusive-OR encryption.
* Dijkstra's Algorithm Learn how to find single-source shortest paths on graphs
* Dynamic Programming with Examples from Graph Algorithms Learn how to use dynamic programming to solve interesting problems including the all-pairs shortest path problem.
* Minimum Spanning Trees and Prim's Algorithm What is a minimum spanning tree, why we care, and how to compute them
* Huffman Encoding Learn how to compress data using the Huffman encoding algorithm
[Top]
Computer Science Theory
* An introduction to the topic of computer science Learn a bit about the history and goals of computer science
* Base Systems - Binary, Hex and Octal Find out how binary, hexadecimal and other bases work
* The Halting Problem Not for the faint of heart (or beginners), this tutorial covers an advanced topic in computer science: the nature of what can and cannot be computed -- what types of problems computers simply cannot solve
* What We Cannot Know: Consequences of the Halting Problem Learn how the theory behind the halting problem can be applied to questions about what we cannot compute
Coding Style
* Programming Style, Part 1: Whitespace Improve your coding style and understand why whitespace matters
* Programming Style, Part 2: Naming Conventions Improve your coding style and understand how to choose good names and what traps to avoid
* Programming Style, Part 3: How you can write readable code, and why you should
* How -- and Why -- to Comment Why commenting makes you a better programmer
[Top]
Compilers and Makefiles
* Unravelling the mysteries of makefiles Learn how make works and how to write a makefile
* Advanced makefile tricks Learn how to write more sophisticated make files
* Dealing with the compilation process Learn how to handle compiler warnings and errors
* Why you should fix compiler warnings Learn why compiler warnings matter, and what some of them mean
Memory Management
* Using auto_ptr to manage memory Learn how to use auto_ptr to help avoid memory leaks
* Dynamic Memory Allocation, Part 1 Part one in the memory allocation series, covering basic use of new and delete, including allocating multidimensional arrays
* Dynamic Memory Allocation, Part 2: Virtual Memory Part two in the memory allocation series, covering virtual memory
* Dynamic Memory Allocation, Part 3: Overloading Operator New and Delete Part three in the memory allocation series, covering overloading operator new and operator delete
* Dynamic Memory Allocation, Part 4: Common Memory Management Problems Part four in the memory allocation series, covering common memory management problems and how to avoid them
Once you're done with these tutorials, take the C++ Memory Management Quiz
Debugging
* GDB Tutorial an introduction to the debugger GDB
* Debugging with Visual Studio, Part 1: Debugging Concepts Part one in a series on debugging with Visual Studio
* Debugging with Visual Studio, Part 2: Setting up the IDE Part two in a series on debugging with Visual Studio
* Debugging with Visual Studio, Part 3: Using Breakpoints Effectively Part three in a series on debugging with Visual Studio
* Debugging with Visual Studio, Part 4: Setting up Code for the Debugger Part four in a series on debugging with Visual Studio
* Debugging with Visual Studio, Part 5: Using Trace and Log Messages Part 5 in a series on debugging with Visual Studio
* Debugging with Visual Studio, Part 6: Remote Debugging Part 6 in a series on debugging with Visual Studio
* 5 Awesome Visual Studio Debugger Features Discover time-saving debugger techniques available in Visual Studio
* Debugging Strategy Help prevent small problems from becoming big headaches with bug prevention, debugging strategies, tips, and gotchas
* Segfaults Learn to hunt segfaults and pointer errors in this tutorial
* Valgrind Find memory leaks and other problems with Valgrind
* Skip Stepping into Functions with Visual Studio's NoStepIntoOption Keep your debugger from stepping into common functions
* How to Avoid, Find (and fix) Memory Errors in Your C/C++ Code Explore the different types of memory errors and how to use Intel Parallel Inspector to debug your code
Other Programming Languages
* Java for C++ Programmers: A Syntax Cheat Sheet A cheat sheet providing a list of numerous small differences between Java and C++.
* A Summary of C# A discussion of the C# programming language, Microsoft's language based on language principles from C and C++
* A Programming Language Comparison Learn more about the different types of programming languages available!
Miscellaneous Programming Articles
* Test Driven Development, The Philosophy Learn about why writing tests first makes sense and how to use unit tests
* Where C and C++ Differ If you're moving from C to C++ (or vice-versa), watch out for these gotchas.
* So you want write a game? Find out what goes into writing a game!
* How do you tell how large an object is? Find out how to determine the size of a class object.
* How to Start Writing a Program Tips on how to avoid getting lost when writing a large program
* Module Development for Game Design Learn some tips and tricks for developing a module system for games
* Debugging binary search: the difficulty of getting your code right the first time The story of a small bet between friends -- can Joe write a perfect binary search function without testing?
* New Year's Resolutions for C/C++ Programmers A few fun resolutions for you to keep this year, or just suggestions of ways to spend some time
* Thinking about Programming A Guide to Program Design for beginners
* Common Coding Mistakes An overview of commonly made programming mistakes.
* The 5 Most Common Problems New Programmers Face--And How You Can Solve Them Discover the solutions to problems that trip up beginning programmers
* The Secret to Learning Anything
* 5 Ways You can Learn Programming Faster Five tips and techniques that will help you learn and remember the most information you can
The C++ Tutorial
Welcome to LearnCpp.com!LearnCpp.com is a totally free website devoted to teaching you to program in C++. Whether you’ve had any prior experience programming or not, the tutorials on this site will walk you through all the steps you’ll need to know in order to create and compile your programs. Becoming an expert programmer won’t happen overnight, but with a little patience, you’ll get there. And LearnCpp.com will show you the way.
Also be sure to check out:
- Our blog, where we discuss programming, C++, WordPress, and whatever else strikes our fancy.
- Our forums, where programmers of all languages and experience levels can discuss programming and non-programming topics. If you have any questions about C++, that is the best place to ask!
No comments:
Post a Comment