Adding informational messages

As you test and debug code you will inevitably come across places where you can see a potential problem but it has low priority compared to what you are working on. It is important to make a note of the issue so that you can address the problem at a later stage. In Visual C++, there are two ways to do this in a benign way and two ways that will generate an error.

The first way is to add a TODO: comment, shown as follows:

    // TODO: potential data loss, review use of shift8 function     unsigned shift8(unsigned char c)      {         return c >> 8;      }

The Visual Studio editor has a tool window called the Task List. This lists the comments in the project that start with one of the predetermined tasks (the defaults are TODO

Get Beginning C++ Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.