background preloader

Lessons and Tutorials

Facebook Twitter

C++ Programming/Exercises/Iterations. Iterations[edit] Solutions requirements Solutions must: Use only standard C++.Be compilable.Be in accordance to general coding practices. (no esoteric demonstrations are required) and should: Handle error situations, even if behavior is not defined. Acceptable default is simply reporting an "Error".Be internally consistent in relation to the adopted coding-style.Be as simple as possible on to the point (use the minimum required variables and function calls/classes and reduces convoluted I/O handling). Please do not add solutions that are 99% similar to another that is already present, if it is an improvement just add it to the existing solution. EXERCISE 1[edit] Write a program that asks the user to type an integer and writes "YOU WIN" if the value is between 56 and 78 (both included). Int main() {int i; cout << "Type all numbers between 58 and 73: " << endl; cin>>i; if (i>=58 && i<=78) { cout << "YOU WIN" << i << endl; else cout<<"YOU LOSE!

" EXERCISE 2[edit] Solution Alternate solution Solution in C. Become a Programmer, Motherfucker. If you don't know how to code, then you can learn even if you think you can't. Thousands of people have learned programming from these fine books: Learn Python The Hard Way Learn Ruby The Hard Way Learn Code The Hard Way I'm also working on a whole series of programming education books at learncodethehardway.org. Learn C The Hard Way Learn SQL The Hard Way Graphics Programming Language Agnostic NerdDinner Walkthrough Assembly Language Bash Clojure Clojure Programming ColdFusion CFML In 100 Minutes Delphi / Pascal Django Djangobook.com Erlang Learn You Some Erlang For Great Good Flex Getting started with Adobe Flex (PDF) Forth Git Grails Getting Start with Grails Haskell Java JavaScript JavaScript (Node.js specific) Latex The Not So Short Introduction to LATEX (perfect for beginners) Linux Advanced Linux Programming Lisp Lua Programming In Lua (for v5 but still largely relevant)Lua Programming Gems (not entirely free, but has a lot of free chapters and accompanying code) Maven Mercurial Nemerle Nemerle NoSQL Oberon Objective-C.

Beginners Guide to Flash. All The Cheat Sheets That A Web Developer Needs. Web Programming Step by Step, Lecture 6-A: Positioning. 20+ Computer Science Programming Online Courses | Free Download. Pointer (computing) While "pointer" has been used to refer to references in general, it more properly applies to data structures whose interface explicitly allows the pointer to be manipulated (arithmetically via pointer arithmetic) as a memory address, as opposed to a magic cookie or capability where this is not possible. [citation needed] Because pointers allow both protected and unprotected access to memory addresses, there are risks associated with using them particularly in the latter case.

Primitive pointers are often stored in a format similar to an integer; however, attempting to dereference or "look up" a pointer whose value was never a valid memory address would cause a program to crash. To alleviate this potential problem, as a matter of type safety, pointers are considered a separate type parameterized by the type of data they point to, even if the underlying representation is an integer. Other measures may also be taken. [which?] Pointers are used to pass parameters by reference.