Ever since I was a little boy and coded my first nested loop, I’ve enjoyed messing with grids in C. I’ve done monthly calendars in grids, rotated grids, manipulated grids mathematically — all sorts of fun girddy stuff. But I’m not done yet.
Continue reading
Messing with Array Subscripts
Array notation involves the array’s name followed by a set of square brackets. Within these brackets is a reference to the array element’s number. It’s important to remember that the first element is zero. But the subscript need not always be a constant integer.
Continue reading
Calculating the Standard Deviation – Solution
The challenge for this month’s Exercise is to calculate the standard deviation for a given set of data points. It’s a “whole population calculation” because all the data points are present. The trick is to follow the equation, transforming it from cryptic math mumbo-jumbo into C code.
Continue reading
Tending Toward Obfuscation
I’m always mindful of the beginner when I write code for this blog. Even with my own code, I often go to pains to write things “the long way” just because I’m in the habit. Not every coder is so thoughtful. The reason is that C tends toward obfuscation. We must revel in this capability.
Continue reading
Calculating the Standard Deviation
Difficulty: ★ ★ ☆ ☆
Even when statistics has barely brushed by you on the subway, you probably know the term standard deviation. It refers to how data is distributed in a group, their distance from the mean. You can use your C programming kung fu to code the standard deviation of a data set, which is the challenge for this month’s Exercise.
Continue reading
From Void to Integer
You can’t just slap a data type upon a variable declared as void. No, a void type can be assigned a pointer. But even then, you can’t just typecast that pointer as an int and get away with it.
Continue reading
Out of the void
The four standard data types in C programming are char, int, float, and double. A fifth type is void, which is used to declare storage of an unknown type. My goal is to see how badly I can abuse this data type.
Continue reading
C Blog 11th Anniversary
Today marks this blog’s 11th anniversary. The first post was made 11 years ago on April 13th, 2013. This date coincided with the release of my book, Beginning Programming with C For Dummies.
Continue reading
Using the epoll() Function to Scan for Standard Input
As with the select() function covered in last week’s Lesson, you can use other networking functions to scan for pending standard input while a program otherwise spins busy. The epoll() family of functions allow for such monitoring.
Continue reading
Calculating the Absolute Value – Solution
This month’s Exercise may not have been challenging. Still, remember that blog is about learning the C language. Sometimes performing what could be a simple task may end up being complex than you anticipated.
Continue reading