Tag Archives: c++

Like Stones: Argument Passing in C++, Part 1

For people new to C++, argument passing can be very hard to understand. Most programming languages handle argument passing “behind the scenes” somehow. Either there is really one form of argument passing (e.g. C), or your choices are determined for … Continue reading

Posted in c++, Programming | Tagged , | 1 Comment

Efficient prime number testing

In nearly every lower-level CS class, students are invariably asked to create a function that can recognize a prime number. There are very good reasons for this. For one thing, the study of prime numbers is one of the longest-running … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Breaking cin for fun and profit

This post was originally written for students in Bunker Hill’s CIT 120 course. Breaking the cin object for validation As you should know, cin is an object. Specifically, it is an object of type istream (or, an instance of the … Continue reading

Posted in c++, Programming | Tagged , | Leave a comment

A beginner’s guide to function design in C/C++

This post was originally written for students in Bunker Hill’s CIT 120 course. Quite a few beginning CS students have trouble with function design. They know the syntax of functions, how to write headers, etc.; but they’re having trouble actually … Continue reading

Posted in c++, Programming | Tagged , | Leave a comment