What is True?

It happens so often, I’m curious as to why the C language standard I/O header file doesn’t define TRUE and FALSE. Then again, what is TRUE and FALSE to a programming language — or to a computer? Why is this value true and that value false in the first place?
Continue reading

Averaging an Array of Unknown Size

Imagine you’re working with an array that has room to store thousands of integer values. You’ve been hired to craft a function that averages those values, but you don’t really know how many values are stored in the array. The guy who gave you the assignment (me), simply said that the array is capped with a zero value.
Continue reading

Capping an Array

Compared to other programming languages, C is weak when it comes to dealing with arrays. The array has a starting point and a variable type. That’s pretty much it. Your code determines where the array ends. That type of programming discipline terrifies coders of other languages.
Continue reading

Just Average

Among the tools missing from the C library, which are ample in other programming languages, are functions that manipulate arrays. I’ve seen functions in other programming languages that slice, dice, mince, and chop an array. One of the more common functions calculates the average of a numeric array.
Continue reading