A practice exercise from the book I'm using (recapping the chapter on various kinds of loops) instructed me to create a program that continually asks the user to input single characters. There are two specifications:

1. The program should terminate when the "$" character is entered.
2. The program should keep a tally of the number of periods entered, and output the total as the program terminates. Basically, the whole idea is loop the input prompt -> count periods -> display this count and then terminate the program when "$" is entered.

Here's the code I have:

```
// Takes character input, tallies periods, stops on dollar sign

#include <iostream>
using namespace std;

int main() {

    char i; // input received
    int j = 0; // counter for # of periods

    cout << "This program will accept single-character entries and report the number of periods you've entered.\n";

    for (;;) {
        do {
            cout << "Please enter a single character, using $ to stop: ";
            cin >> i;

            if(i == '.')
                j++;
        } while(i != '$');

    if(i == '$')
        cout << "Total number of periods entered is " << j << " .";
        break;

    }
    return 0;
}

```

The program works fine and the code looks efficient to me, please correct me if I'm wrong. What seems strange to me is the use of the infinite for{} loop around the majority of the code. The chapter used this once or twice so it's the only way I currently know of to make a loop function in this manner.

Perhaps it's just my inexperience with the language, but **is the use of a loop with `(;;)` here a typical occurrence in C++?** The syntax of having a loop with no parameters defined seems to make sense for what I needed to do, but the whole for(;;){} block still looks strange to me.