[5.8] How do I post a question about code that doesn't work correctly?
Key guidelines:
- Post compile'able code: avoid ellipses, such as void
f() { ... }
- Post complete code: put in all necessary #includes and
declarations of needed types and functions
- Post minimal code: just enough to demonstrate the problem;
skip I/O and calls to libraries if possible
- Post one compilation unit: if possible, combine
Foo.h into Foo.cpp
- Post the tools you used: compiler name, version number,
operating system, etc
- Post the tool options you used: libraries, exact compiler
and linker options, etc
- Post the exact messages you received; differentiate between
compiler, linker, and runtime messages
- Make sure main() has a return type of
int, not void!
As always, make sure your question isn't already in the FAQ. Use the
subject index to check.