//
" and ends just
after the first newline after the "//
" characters.
/*
" and ends just
after the first occurrence of the characters "*/
" following the
"/*
" characters.
Write an algorithm that searches a string for the first occurrence of either type of C++ comment.
The logical state represents entities used to describe the interface to a class (or a library, or whatever), while the physical state represents the entities used to implement the interface. For example, given a stack class implemented with an array, the physical state includes the array and (possible) a index indicating the top of stack. Neither the array or the index would appear as part of the logical state.
Class invariants describe properties of the physical state that are always true. They are important because they define the principle link between the physical state and the logical state.
When starting a debugging task, the only thing that's known is the symptoms of the problem. Successful debugging requires that the symptoms be followed backward to the cause of the problem, which can then be fixed.
This page last modified on 2 March 2001.