background preloader

C, C++, C#

Facebook Twitter

C Craft - Preface. Let me open with a disclaimer.

C Craft - Preface

What follows is an unabashedly opinionated diatribe certain to offend many programmers. Craftsmen inevitably grow defensive of their favourite tools and practices. Rather than respect this natural sensitivity, I will exploit it, shamelessly intensifying the vitriol for attention. I care little whether one applauds or deplores my views; I mainly want my audience to feel compelled to read on. However, I try to be informative as well as incendiary. Thanks to Dan Henry, Asim Jalis, Harold Lee, Gazsó Attila, Tim MacEachern, Boyko Bantchev, Kevin Easton, Dillon Shook, Samy Bahra, Ed Catmur, and Daniel Griffith for supplying corrections.

I began my journey with BASIC, when I was easily amused: for example, I liked being able to change the colour of the screen with a simple command. A few years later, I heard about C. A few more years later, I learned x86 assembly language. By the way, I feel all programmers benefit from learning assembly. WxWidgets. How C Programming Works" The C programming language is a popular and widely used programming language for creating computer programs.

How C Programming Works"

Programmers around the world embrace C because it gives maximum control and efficiency to the programmer. If you are a programmer, or if you are interested in becoming a programmer, there are a couple of benefits you gain from learning C: You will be able to read and write code for a large number of platforms -- everything from microcontrollers to the most advanced scientific systems can be written in C, and many modern operating systems are written in C.The jump to the object oriented C++ language becomes much easier. C++ is an extension of C, and it is nearly impossible to learn C++ without learning C first. In this article, we will walk through the entire language and show you how to become a C programmer, starting at the beginning.

1.6 Statements. The if statement evaluates an expression.

1.6 Statements

If that expression is true, then a statement is executed. If an else clause is given and if the expression is false, then the else's statement is executed. Syntax: if( expression ) statement1;orif( expression ) statement1; else statement2 ; Examples: if(loop<3) counter++; if(x==y) x++; else y++; if(z>x) { z=5; x=3; } else { z=3; x=5; } A switch statement allows a single variable to be compared with several possible constants. Examples: If betty is 1, then two lines are printed: betty=1 and betty=2. The while statement provides an iterative loop. While( expression ) statement...