background preloader

C++ Reference [C++ Reference]

C++ Reference [C++ Reference]

Pointer Basics This document introduces the basics of pointers as they work in several computer languages -- C, C++, Java, and Pascal. This document is the companion document for the Pointer Fun with Binky digital video, or it may be used by itself. This is document 106 in the Stanford CS Education Library. Section 1 -- Pointer Rules One of the nice things about pointers is that the rules which govern how they work are pretty simple. 1) Pointers and Pointees A pointer stores a reference to something. The above drawing shows a pointer named x pointing to a pointee which is storing the value 42. Allocating a pointer and allocating a pointee for it to point to are two separate steps. 2) Dereferencing The dereference operation starts at the pointer and follows its arrow over to access its pointee. The dereference operation on a pointer only works if the pointer has a pointee -- the pointee must be allocated and the pointer must be set to point to it. 3) Pointer Assignment Section 3 -- Study Questions

C Tutorial gotoAndLearn() - Free video tutorials from Lee Brimelow on Adobe Flash Low Level Bit Hacks You Absolutely Must Know I decided to write an article about a thing that is second nature to embedded systems programmers - low level bit hacks. Bit hacks are ingenious little programming tricks that manipulate integers in a smart and efficient manner. Instead of performing some operation (such as counting the 1 bits in an integer) by looping over individual bits, these programming nuggets do the same with one or two carefully chosen bitwise operations. To get things going I'll assume that you know what the two's complement binary representation of an integer is and also that you know all the the bitwise operations. I'll use the following notation for bitwise operations in the article: & - bitwise and | - bitwise or ^ - bitwise xor ~ - bitwise not << - bitwise shift left >> - bitwise shift right The numbers in the article are 8 bit signed integers (though the operations work on arbitrary length signed integers) that are represented as two's complement and they are usually named 'x'. Here we go. Bit Hack #1. 1. 2.

Programming Methodology - Download free content from Stanford Optimizing C and C++ Code Embedded software often runs on processors with limited computation power, thus optimizing the code becomes a necessity. In this article we will explore the following optimization techniques for C and C++ code developed for Real-time and Embedded Systems. Many techniques discussed here have roots in the material we covered in the articles dealing with C to Assembly translation. A good understanding of the following articles will help: Premature optimization is the root of all evil Donald Knuth wrote, "Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. In general, correctness and readability considerations trump code performance issues for most of your code. Adjust structure sizes to power of two Place case labels in narrow range Place frequent case labels first Splitting a switch statement

Contributions to Information Technology Free Books A lot of people keep asking about a good list of programming books. Hence, we are building this list to save your time and to spread the knowledge. Some of these books will definitely help us to evolve our coding skills and thought processes for developing better solutions. Meta-List Graphics Programming Language Agnostic: NerdDinner Walkthrough Assembly Language: Bash Advanced Bash-Scripting Guide See .NET below Django Djangobook.com Emacs The Emacs manual Thanks Emacser (October 17, 2010) Forth Git Haskell Dive Into HTML5 Java JavaScript Linux Advanced Linux Programming Lisp Lua Programming In Lua (for v5 but still largely relevant) Maven Mercurial NoSQL CouchDB: The Definitive Guide Objective-C The Objective-C Programming Language Parrot / Perl 6 Perl 6 (Work in progress) Perl PowerShell Mastering PowerShell Prolog PostgreSQL Practical PostgreSQL Python Learn REBOL Thanks Nick (October 19, 2010) Ruby Scala Scheme The Scheme Programming Language (Edition 4) Smalltalk Subversion SQL (Implementation agnostic) Symfony Vim

Scripting Languages: PHP, Perl, Python, Ruby - Hyperpolyglot a side-by-side reference sheet sheet one: version | grammar and execution | variables and expressions | arithmetic and logic | strings | regexes | dates and time | arrays | dictionaries | functions | execution control | exceptions | threads sheet two: streams | asynchronous events | files | file formats | directories | processes and environment | option parsing | libraries and namespaces | objects | inheritance and polymorphism | reflection | net and web | gui | databases | unit tests | logging | debugging sheet two: streams | asynchronous events | files | directories | processes and environment | option parsing | libraries and namespaces | objects | inheritance and polymorphism | reflection | net and web | gui | databases | unit tests | logging | debugging version used The versions used for testing code in the reference sheet. show version How to get the version. php: The function phpversion() will return the version number as a string. python: import platform platform.python_version() ruby: <? pad

6 Books Every Programmer Should Own I’ve seen many lists about the best programming books and I am sure there are a lot of books that are specific to a programming knowledge or technology – that I have not included in my list. The books I have chosen are those that are meant to inspire, increase productivity and improve your programming design skills. Note: This list has no particular order. Code Complete 2 Steve McConnell The main focus of this book to help you improve your programming design skills. The Pragmatic Programmer: From Journeyman to Master Andrew Hunt and David Thomas This book focuses on the best practices of programming (i.e. what you should and should not do). Pragmatic Thinking and Learning: Refactor Your Wetware Andy Hunt From the author of The Pragmatic Programmer, this book takes one-step back from programming and focuses on your everyday thinking and problem solving skills. The Productive Programmer Neal Ford and David Bock Algorithms in a Nutshell George T Heineman, Gary Pollice and Stanley Selkow Thomas H.

s | Good stuff for serious developers: Programming Tools, Code, C++, Java, HTML5, Cloud, Mobile, Testing Free Programming Books Here is an uncategorized list of online programming books available for free download. The books cover all major programming languages: Ada, Assembly, Basic, C, C#, C++, CGI, JavaScript, Perl, Delphi, Pascal, Haskell, Java, Lisp, PHP, Prolog, Python, Ruby, as well as some other languages, game programming, and software engineering. The books are in various formats for online reading or downloading. This list will be updated daily. Scroll downn, or use the shortcuts below.

Related: