A Little Bit Off the Sides

Difficulty: ★ ★ ★ ☆

As you might already know, the C language lacks plenty o’ functions readily available in other programming languages. Many of these functions, or “methods,” deal with strings. Though C includes a few basic string functions in its library, the C Lords have determined that when you need another such function, you must code it yourself.
Continue reading

Pulling Numbers from a String

Difficulty: ★ ★ ★ ★

Rarely in your programming journey will you encounter a situation where the data you need just pops up fresh, exactly the way you want it. The best situation is where the data is somehow formatted, which makes finding the tidbit you want easier. But often the data is unformatted, which makes fetching that one useful morsel a bit tricky.
Continue reading

Which is Greatest?

Difficulty: ★ ★ ★ ☆

One of the first functions many C programmers code is max(). It returns the largest of two values. Though this operation can also take place by using a simple if-else comparison, it’s a great way to teach how functions work and test various comparison operators. But this task isn’t the challenge for this month’s exercise.
Continue reading

Having Fun with goto

Difficulty: ★ ★ ★ ☆

Among the C language’s slender assortment of keywords you find goto. It’s a branching statement, which can be used to loop or to escape from some ugly programming knot. Regardless, you’re told early on in your C language education that you must avoid this keyword at all costs! That is, unless you want to try this month’s exercise.
Continue reading