5
votes
3answers
108 views

Matching square brackets

I wrote this program to match square brackets as part of a Brainf**k interpreter. I'm aware that it gets caught in an infinite loop if brackets are entered like this: ...
12
votes
3answers
172 views

Credit card verification: string conversion most optimal?

Below is some code which verifies a credit card number using the checksum as well as check if number of digits are appropriate as well if digits start with right numbers. I am not sure if converting ...
7
votes
2answers
152 views

Inputting and displaying strings

I have written some code for one of my assignments. However, I feel that I am repeating myself slightly in a few places. I have that niggling feeling that there is a better way to do things. Here ...