string s;
but instead wrote
strng s;
* You will certainly get an error message for the unknown symbol strng. However, there's also the factor that the compiler really doesn't know what types any symbol of unknown type is supposed to be an int. So every time you subsequently uses in a "string-like" mananer, e.g.,
s = s + "abcdef";
or
sting t = s.substring(k,m);
* The compiler will probably issue further complaints. Sometimes, therefore, it's best to stop after fixing a few declaration errors and recompile to see how many of the other messages need to be taken seriously.
* Backtracking A compiler can only report where it detected a problem. Where you actually committed a mistake may be someplace entirely different.
The vast majority of error messages that C++ programmers will see are
* syntax eror (missing brackets, semi-colons, etc.)
undeclared symbols
undefined symbols
type errors (usually "cannot find a matching function" complaints)
const errors
Let's look at these from the point of view of the compiler.
댓글 없음:
댓글 쓰기