Skip to primary content
Skip to secondary content

C For Dummies Blog

Main menu

  • C For Dummies (home)
  • History
  • Series
  • Supplemental
  • Blog Miscellany

Post navigation

← Older posts
Newer posts →

Adding Two Values – Solutions

Posted on June 8, 2024 by dgookin
Reply

This month’s Exercise is rather simple, though it doesn’t promise a simple solution. Instead, I offer three solutions. One of which is obvious and two are kind of out there. They all work, which is the point.
Continue reading →

Posted in Solution | Leave a reply

Adding Two Values

Posted on June 1, 2024 by dgookin
Reply

Difficulty: ★ ☆ ☆ ☆

Adding values is a basic programming concept: 4 + 5 = 9 But where do the values come from? They can be literals, variables, expressions, or values collected from the user.
Continue reading →

Posted in Exercise | Leave a reply

A Grid of Random Stars, Part III

Posted on June 1, 2024 by dgookin
Reply

The next update to my pattern-finding program is to hunt down and find a clutch of asterisks in the grid that form a rectangle. Figure 1 illustrates what I’m after.
Continue reading →

Posted in Lesson | Leave a reply

A Grid of Random Stars, Part II

Posted on May 25, 2024 by dgookin
Reply

To count all possible rectangles in a random grid requires a lot of scanning. My first thought was that the process would involve recursion. I wasn’t 100 percent certain, but I wanted to prep the code for such a possibility.
Continue reading →

Posted in Lesson | Leave a reply

Analyzing a Grid of Random Stars

Posted on May 18, 2024 by dgookin
Reply

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 →

Posted in Lesson | Leave a reply

Messing with Array Subscripts

Posted on May 11, 2024 by dgookin
4

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 →

Posted in Lesson | 4 Replies

Calculating the Standard Deviation – Solution

Posted on May 8, 2024 by dgookin
6

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 →

Posted in Solution | 6 Replies

Tending Toward Obfuscation

Posted on May 4, 2024 by dgookin
Reply

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 →

Posted in Lesson | Leave a reply

Calculating the Standard Deviation

Posted on May 1, 2024 by dgookin
Reply

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 →

Posted in Exercise | Leave a reply

From Void to Integer

Posted on April 27, 2024 by dgookin
3

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 →

Posted in Lesson | 3 Replies

Post navigation

← Older posts
Newer posts →

Recent Posts

  • Finding a Binary Date
  • Having Fun with goto – Solution
  • Today’s Date is Binary!
  • Having Fun with goto
  • Filling the Pointer Pointers with Data

Recent Comments

  • dgookin on Having Fun with goto
  • M.Stumpfl on Having Fun with goto
  • dgookin on Having Fun with goto
  • M.Stumpfl on Having Fun with goto
  • M.Stumpfl on Having Fun with goto

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 1997-2025 by QPBC.
All rights reserved

Proudly powered by WordPress