cprogramming.com - tutorials: c++ made easy

来源:百度文库 编辑:神马文学网 时间:2024/04/28 05:16:54
Programming Tutorials
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 code C). Pleaseemail me with corrections or submissions to this page. Would you like touse these tutorials on your site? Information for those of youhaving trouble keeping your program open.
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 on functions(non-prototyed and inline) (Quiz)Command line arguments How to accept command line arguments (AND checking file existence) (Quiz)Linked Lists The basics of singly linked listsRecursion Recursion--a function calling itselfVariable argument lists Functions accepting a variable number of argumentsBinary Trees Introduction to an important abstract data typeInheritance Inheritance - An OverviewInheritance continued Inheritance - Syntax and examplesFormatted Output in C++ using iomanip Learn how to create nicely formatted output in C++Generating random Numbers Article by RoD on generating random numbers.Using Modulus Article by RoD on the modulus operatorTemplates in C++ Learn how to use templated classes in C++Templated functions Templates can be used to write generic functions as well as generic classesTemplate specialization and partial specialization Learn how to optimize templates by creating specialized instances for certain typesUnderstanding the C Preprocessor -- Constants, Macros, and other Tricks Learn how to use the C preprocessor
More Advanced C and C++ Language Features
Bitwise Operators in C and C++ Learn how to use bitwise operatorsWhen 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 functionalityGetting out the static Keyword A multipurpose keywords, static can be used globally, locally, and on class variables, with different meanings in each contextFile I/O in C Strict C file I/O and binary file I/OTemplated Classes in C++ Templates in C++Using auto_ptr to manage memory Learn how to use auto_ptr to help avoid memory leaksC++ style strings C++ strings can save you a lot of time and frustration when used correctlyThe friend keyword and data encapsulation Learn how to use the friend keyword to simplify class interaction while preserving data encapsulation
AI Tutorials courtesy of AIhorizon.com
Perceptrons Learn about a simple way to simulate neuronsMiniMax Game Trees Learn about coding a decision-making programChess Board Representation Learn about efficient chess board representations
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. PrecisionFloating Point RepresentationBonus: Printing Floating Point Numbers Cleanly
Using Remote Procedure Calls (RPCs) by Jeff Bezanson
Background and Using the RPC compilerWriting the Server CodeWriting the Client and Putting it All TogetherGet the code
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 rotationsRotation MatricesRotation about an Arbitrary AxisUses for what you‘ve learnedUsing Quaternions
OpenGL Tutorials by RoD
Intro to OpenGLOpenGL vs DirectX Comparison of OpenGL and DirectXOpenGL and Windows Intro to Windows Programming for OpenGLThe WinMain procedure More Windows Programming backgroundWindows Programming The guts of Windows ApplicationsIntro to WGL Intro to Windows Graphics LayerGetting started with OpenGL The first OpenGL programProjections Using Projects in OpenGL
Standard Template Library
An Introduction to the Standard Template Library (STL) An introduction to and explanation of the Standard Template Library and its featuresThe STL Vector Container A tutorial on using the vector classSTL Iterators A tutorial covering iterators, an important component of the Standard Template Library for accessing elements of collectionsSTL Map Container Learn how to use associative arrays in the C++ Standard Template Library to store (key, value) pairsSTL List Container Learn how to use linked lists in the C++ Standard Template Library to store data
Algorithms, Data Structures and Theory in Computer Science
An introduction to the topic of computer science Learn a bit about the history and goals of computer scienceAlgorithmic Efficiency and Big-O notation How to determine the efficiency of your program and understand common algorithmsEfficiency, Time and Space Learn how time and space are balanced in the design of algorithmsSearch Algorithms Covers various techniques for search algorithms, from linear search to advanced versions of binary searchGraphs in computer science Learn the difference between directed and undirected graphs and why they‘re usefulDijkstra‘s Algorithm Learn how to find single-source shortest paths on graphsDynamic 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 themHeaps Learn what a heap is, why, when and how to use heapsHuffman Encoding Learn how to compress data using the Huffman encoding algorithmStacks in Computer Science Learn what a stack is and when it might be usedThe Queue Data Structure Read about what a queue is and how to implement itTwo-three trees Learn about a data structured that helps with balancing the search treeComparison of Sorting Algorithms See how the various sorting algorithms compare (and how to compare them) and pick which ones to useIntro to sorting algorithms: bubble sort Learn about sorting algorithms, bubble sort, and how it compares to other sorting methodsSelection sort and Insertion sort Two sorting algorithms usually superior to bubble sortHeap 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 stableRadix Sort Learn about radix sort, a special case sorting algorithm for certain inputsThe 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 solveWhat 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
Programming Articles
Module Development for Game Design Learn some tips and tricks for developing a module system for gamesSecure Coding Learn how to make your programs safe against buffer overflow and double free attacksSolving cool problems with genetic algorithms An overview of how genetic algorithms work, and how they‘ve been used.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, of just suggestsions of ways to spend some timeHow -- and Why -- to Comment Why commenting makes you a better programmerThinking about Programming A Guide to Program Design for beginnersExclusive-OR (XOR) Encryption A tutorial on Exclusive-OR encryption.Common Coding Mistakes An overview of commonly made programming mistakes.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!
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 tutorialshere.The MCGA mode and how you get into it in C++ without a BGI What is the Pallette?Circle and line algorithmsWhat 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 AnimationOptimisation3D System